Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with symmetric grids #451

Merged
merged 12 commits into from
Apr 2, 2023
Merged

issue with symmetric grids #451

merged 12 commits into from
Apr 2, 2023

Conversation

unalmis
Copy link
Collaborator

@unalmis unalmis commented Mar 13, 2023

Fixes issues with symmetric grids.

  • On LinearGrid, specifying nodes at coordinates $\theta \in$ [0, $\pi$] is now sufficient when sym=True.
  • When sym=True, nodes at coordinates $\theta$ mod $\pi = 0$ should not have their $d\theta$ scaled up.
  • LinearGrid can now handle non-uniformly spaced nodes if the user passes them when sym=True.
  • Corrects grid.weights on ConcentricGrid with sym=True.
    • Resolving example equilibria and tightening those test tolerances to be done in different PR.
  • More tests.

desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
desc/grid.py Outdated Show resolved Hide resolved
tests/test_grid.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage: 96.72% and no project coverage change.

Comparison is base (6a06623) 93.84% compared to head (166e30d) 93.84%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #451   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files          72       72           
  Lines       15008    15019   +11     
=======================================
+ Hits        14084    14095   +11     
  Misses        924      924           
Impacted Files Coverage Δ
desc/grid.py 98.20% <96.72%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@unalmis unalmis marked this pull request as ready for review March 15, 2023 23:17
@unalmis unalmis requested a review from dpanici March 15, 2023 23:19
@unalmis
Copy link
Collaborator Author

unalmis commented Mar 15, 2023

If some of the grid spacing tests are a chore to review, it might be easier to just check results directly. For convenience:

import sys
import os
sys.path.insert(0, os.path.abspath("."))
# sys.path.append(os.path.abspath("../../"))
from desc.grid import *
from desc.plotting import plot_grid
import numpy as np

theta = np.linspace() or integer
lg = LinearGrid(rho=, theta=, zeta=, sym=)
print(lg.spacing[:, 1])
plot_grid(lg)

@unalmis unalmis changed the title Linear grid sym issue with symmetric grids Mar 15, 2023
desc/grid.py Show resolved Hide resolved
@unalmis unalmis merged commit bdea962 into master Apr 2, 2023
@unalmis unalmis deleted the linear_grid_sym branch April 2, 2023 11:01
@unalmis unalmis restored the linear_grid_sym branch April 4, 2023 01:22
@unalmis unalmis deleted the linear_grid_sym branch April 5, 2023 03:01
@unalmis unalmis mentioned this pull request Jan 8, 2024
@unalmis unalmis added the bug fix Something was fixed label Jul 22, 2024
@unalmis unalmis self-assigned this Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Something was fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants