Skip to content

Commit

Permalink
Explain to users why variable computations may differ (#1615)
Browse files Browse the repository at this point in the history
Resolves #1424
(#1424 (comment))
and resolves #1614.
  • Loading branch information
unalmis authored Mar 3, 2025
1 parent d26388a commit 63b006b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion desc/compute/_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -2488,7 +2488,8 @@ def _B_sub_zeta_rz(params, transforms, profiles, data, **kwargs):
label="\\langle |\\mathbf{B}| \\rangle_{axis}",
units="T",
units_long="Tesla",
description="Average magnitude of magnetic field on the magnetic axis",
description="Average magnitude of magnetic field on the innermost flux surface "
"on the given grid",
dim=0,
params=[],
transforms={"grid": []},
Expand Down
4 changes: 2 additions & 2 deletions desc/integrals/singularities.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def best_ratio(data, return_local=False):
Parameters
----------
data : dict[str, jnp.ndarray]
Dictionary of data evaluated on grid that ``can_fft2`` with keys
``|e_theta x e_zeta|``, ``e_theta``, and ``e_zeta``.
Dictionary of data evaluated on single flux surface grid that
``can_fft2`` with keys ``|e_theta x e_zeta|``, ``e_theta``, and ``e_zeta``.
return_local : bool
Whether to return the local ratio as well as the mean global ratio.
Expand Down
7 changes: 7 additions & 0 deletions docs/write_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ def write_csv(parameterization):
those of the DESC :math:`\rho, \theta, \zeta` coordinate system. For example, ``|B|_z``
is :math:`(\partial \vert B \vert / \partial\zeta)|_{\rho, \theta}`.
Many quantities require special grids to compute accurately.
To not burden users with such bookkeeping,
when an object method such as ``eq.compute(...,override_grid=True)`` is called,
DESC will automatically use a set of best grids for the computation.
However, when writing objectives developers must perform the bookkeeping
and ensure everything can be computed accurately on the chosen grid.
"""

block = """
Expand Down

0 comments on commit 63b006b

Please sign in to comment.