Skip to content

Commit

Permalink
Specify units in docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Aug 20, 2021
1 parent 9430117 commit 01191ac
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tardis/visualization/tools/sdec_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,8 @@ def generate_plot_mpl(
observed_spectrum : tuple or list of astropy.Quantity, optional
Option to plot an observed spectrum in the SDEC plot. If given, the first element
should be the wavelength and the second element should be flux,
i.e. (wavelength, flux)
i.e. (wavelength, flux). The assumed units for wavelength and flux are
angstroms and erg/(angstroms * s * /cm^2), respectively. Default value is None.
show_modeled_spectrum : bool, optional
Whether to show modeled spectrum in SDEC Plot. Default value is
True
Expand Down Expand Up @@ -1187,7 +1188,10 @@ def generate_plot_mpl(
if observed_spectrum:
if distance is None:
raise ValueError(
"Distance must be specified if an observed_spectrum is given"
"""
Distance must be specified if an observed_spectrum is given
so that the model spectrum can be converted into flux space correctly.
"""
)

observed_spectrum_wavelength = None
Expand Down Expand Up @@ -1501,7 +1505,8 @@ def generate_plot_ply(
observed_spectrum : tuple or list of astropy.Quantity, optional
Option to plot an observed spectrum in the SDEC plot. If given, the first element
should be the wavelength and the second element should be flux,
i.e. (wavelength, flux)
i.e. (wavelength, flux). The assumed units for wavelength and flux are
angstroms and erg/(angstroms * s * /cm^2), respectively. Default value is None.
show_modeled_spectrum : bool, optional
Whether to show modeled spectrum in SDEC Plot. Default value is
True
Expand Down Expand Up @@ -1582,7 +1587,10 @@ def generate_plot_ply(
if observed_spectrum:
if distance is None:
raise ValueError(
"Distance must be specified if an observed_spectrum is given"
"""
Distance must be specified if an observed_spectrum is given
so that the model spectrum can be converted into flux space correctly.
"""
)

observed_spectrum_wavelength = None
Expand Down

0 comments on commit 01191ac

Please sign in to comment.