Skip to content

Commit

Permalink
Merge pull request #206 from neutrinoceros/fix_radmc3dwriter_docstring
Browse files Browse the repository at this point in the history
DOC: fix RadMC3DWriter's docstring (compat with modern yt)
  • Loading branch information
brittonsmith committed Jul 20, 2023
2 parents 60bcffc + 88a6363 commit 934bb9b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions yt_astro_analysis/radmc3d_export/RadMC3DInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,19 @@ class RadMC3DWriter:
included in the radiative transfer calculation by radmc3d:
>>> import yt
>>> import unyt as un
>>> from yt.extensions.astro_analysis.radmc3d_export.api import RadMC3DWriter
>>> x_co = 1.0e-4
>>> mu_h = yt.Quantity(2.34e-24, 'g')
>>> mu_h = un.unyt_quantity(2.34e-24, 'g')
>>> def _NumberDensityCO(field, data):
... return (x_co/mu_h)*data["Density"]
>>> yt.add_field("NumberDensityCO", function=_NumberDensityCO)
... return (x_co/mu_h)*data["gas", "density"]
>>> yt.add_field(
... ("gas", "NumberDensityCO"),
... function=_NumberDensityCO,
... sampling_type="cell",
... units="cm**-3",
... )
>>> ds = yt.load("galaxy0030/galaxy0030")
>>> writer = RadMC3DWriter(ds)
Expand Down

0 comments on commit 934bb9b

Please sign in to comment.