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

Fixes numpydoc for util #969

Merged
merged 6 commits into from
Nov 19, 2019
Merged

Conversation

kowal180
Copy link
Contributor

@kowal180 kowal180 commented Oct 17, 2019

In the process of fixing all the numpydoc problems in the util package. This is in relation to #680.

  • int_to_roman

  • roman_to_int

  • calculate_luminosity

  • create_synpp_yaml

  • intensity_black_body

  • species_tuple_to_string

  • species_string_to_tuple

  • parse_quantity

  • element_symbol2atomic_number

  • atomic_number2element_symbol

  • reformat_element_symbol

  • quantity_linspace

  • convert_abundances_format

@@ -72,6 +72,20 @@ def __str__(self):
))

def int_to_roman(i):
"""
Convert an integer i into its roman numeral representation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably leave out the i - because that parameter is already described below.

-------
: str
Returns roman numeral representation of i in str format.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this newline standard for numpydoc

@marxwillia
Copy link
Contributor

@kowal180 the tests are failing on github. Do they run locally? The last merge into the master branch passed the test, so I'm not sure what the problem is.

@@ -307,6 +439,17 @@ def quantity_linspace(start, stop, num, **kwargs):


def convert_abundances_format(fname, delimiter='\s+'):
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lookup docstring indentation

@@ -253,6 +354,20 @@ def parse_quantity(quantity_string):


def element_symbol2atomic_number(element_string):
"""
Takes an element symbol and returns its corresponding atomic number
Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline missing

@kowal180
Copy link
Contributor Author

kowal180 commented Oct 27, 2019

moved to top

wavelength_unit: float, optional(default = u.angstrom)
Dictates units used for calculating wavelength.
flux_column: int, optional(default = 1)
#UNSURE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#UNSURE
column index in which the flux is stored

Parameters
----------
nu: int
Frequency of a wave of light
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Frequency of a wave of light
Frequency of light


.. math::
I(\\nu, T) = \\frac{2h\\nu^3}{c^2}\frac{1}{e^{h\\nu \\beta_\\textrm{rad}} - 1}

Parameters
----------
nu: int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is a float

----------
nu: int
Frequency of a wave of light
T: int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float

Parameters
----------
species_string: str
String containing element symbol and number of electrons missing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
String containing element symbol and number of electrons missing
String containing species symbol (e.g. Si II, Fe III)

String containing element symbol and number of electrons missing

Returns
----------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the minuses just as long as the Returns or Raises


Returns
-------
:str
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space missing


Returns
-------
:int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space missing

Parameters
----------
radial1d_mdl
fname
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file name for the synpp yaml

nu: int
Frequency of a wave of light
T: int
nu: flot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float not flot 😉

@@ -121,6 +162,16 @@ def calculate_luminosity(spec_fname, distance, wavelength_column=0, wavelength_u


def create_synpp_yaml(radial1d_mdl, fname, shell_no=0, lines_db=None):
"""
#UNSURE
Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a yaml file that is readable from syn++

@wkerzendorf wkerzendorf merged commit 537ea72 into tardis-sn:master Nov 19, 2019
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
* Fixes numpydoc for until.py

* Address comments by @wkerzendorf

* Continued working on numpydoc_fix

* Continuation of work on numpydoc_fix

* Adressing fixes proposed by @wkerzendorf

* Small fixes to numpydoc format of base.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants