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

Many docstrings are inconsistent with the numpydoc format #680

Closed
ftsamis opened this issue Dec 16, 2016 · 5 comments · Fixed by #1359
Closed

Many docstrings are inconsistent with the numpydoc format #680

ftsamis opened this issue Dec 16, 2016 · 5 comments · Fixed by #1359

Comments

@ftsamis
Copy link
Member

ftsamis commented Dec 16, 2016

Using the numpydoc format allows for type hinting in PyCharm and easy linking to other docstrings. However, in many places the docstrings violate this format, breaking the type hinting for PyCharm.

An example:

def calculate_density_after_time(densities, time_0, time_explosion):
    """
    scale the density from an initial time of the model to the
    time of the explosion by ^-3

    Parameters:
    -----------

    densities: ~astropy.units.Quantity
        densities

    time_0: ~astropy.units.Quantity
        time of the model

    time_explosion: ~astropy.units.Quantity
        time to be scaled to

    Returns:
    --------

    scaled_density
    """

Here, the keyword "Parameters" is followed by a colon, immediately breaking type hinting, and furthermore the parameter types start with a "~", which is unnecessary and also breaks class resolving.

There are probably more kinds of docstring errors in other places too, so this needs some careful research.

Note: You can view the formatted documentation of an object with ctrl + q in PyCharm.

@nitinkgp23
Copy link

Hey, I am newcomer here and I would like to work on this issue. Can someone help me in going forward with this?

@yeganer
Copy link
Contributor

yeganer commented Jan 27, 2017

What questions do you have?

@unoebauer
Copy link
Contributor

We may think about making an aggregate issue, collection everything related to coding style.

@debajyotidasgupta
Copy link
Contributor

hello,
i am new to this organisation and would like to take this as my first pr
It would be helpful if tell me what all changes should i make?

@ImmortalRabbit
Copy link

Is this issue still open? It's just something was merged already.

marxwillia added a commit that referenced this issue Mar 9, 2020
Solves issue #680 for tardis.util.base (i.e. numpydocs format for doc strings.)
KevinCawley added a commit to KevinCawley/tardis that referenced this issue Nov 22, 2020
KevinCawley added a commit to KevinCawley/tardis that referenced this issue Nov 22, 2020
KevinCawley added a commit to KevinCawley/tardis that referenced this issue Nov 22, 2020
KevinCawley added a commit to KevinCawley/tardis that referenced this issue Nov 22, 2020
@KevinCawley KevinCawley mentioned this issue Nov 25, 2020
7 tasks
@andrewfullard andrewfullard linked a pull request Nov 25, 2020 that will close this issue
7 tasks
wkerzendorf pushed a commit that referenced this issue Nov 30, 2020
* Inside of tardis/docs/pphysics/plasma/plasma_plots updated two files multi-line # to be docstrings where appropriate

* Some more documentation updates

* Finished issue #680

* Fixed the last file for #680

* Fixed two random indentation irregularities found upon review

* Update base.py

* Update base.py

* Update packet_source.py

Going through and writing documentation guidelines, noticed that the carriage returns at line 450 and 456 were missing somehow, most likely from me missing them. I added those two carriage returns to make them consistent with the rest of the docstrings.
KevinCawley added a commit to KevinCawley/tardis that referenced this issue Dec 2, 2020
andrewfullard pushed a commit that referenced this issue Dec 18, 2020
* Fixed to the montecarlo_numba file to compy w/ issue #680

* Fixed the latex equation

* Trying to fix merge conflict

* revert to conf.py

* Remove extra carriage return

* Update tardis/io/decay.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update decay.py

* Update interaction.py

* Update tardis/plasma/properties/atomic.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update single_packet_loop.py

* Update atomic.py

Fixed the formatting in regards to @jalahdh-singhal 's comments

* Update numba_interface.py

Changed the numba.array to numba.ndarray

* Update r_packet.py

Changed the r_packet type from RPacket to tardis.montecarlo.montecarlo_numba.r_packet.RPacket

* Update ion_population.py

Changed the Pandas DataFrame to pandas.DataFrame, and Numpy Array to numpy.ndarray. Made sure that the indentation was consistent as well.

* Update atomic.py

Changed to Pandas DataFrame/Series/MultiIndex to be pandas.DataFrame/Series/MultiIndex. Also changed the numpy descriptor to numpy.ndarray, and for now moved the type as a comment.

* fixing merge conflicts

* Changed the returns to fit what type they are

Returns were mostly in : descriptor. Changed them to just be what type, which they are pandas.DataFrame as seen from the inheritance of the class IsotopeAbundances.

* Modification to docstrings and addressing comments

* Update base.py

Removed trailing carriage returns on docstrings

* Update interaction.py

Naming the variables by their full extensions, not just the class that they are.

* Update macro_atom.py

Added the whole path (.NumbaPlasma) to the end of the description so the entire path is present.

* Update r_packet.py

Made the complete path for variables

* Update atomic.py

Updated the descriptions to try and match comments. Fixed the descriptors for the numpy.ndarrays to make them in the same line.

* Update ion_population.py

Fixing the format of docstrings so that the dtype would be same line as the var : type

* Update docs/index.rst

Co-authored-by: Jaladh Singhal <[email protected]>

* Update tardis/plasma/properties/atomic.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update tardis/io/decay.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update decay.py

* Update r_packet.py

Co-authored-by: Jaladh Singhal <[email protected]>
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
Solves issue tardis-sn#680 for tardis.util.base (i.e. numpydocs format for doc strings.)
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
* Inside of tardis/docs/pphysics/plasma/plasma_plots updated two files multi-line # to be docstrings where appropriate

* Some more documentation updates

* Finished issue tardis-sn#680

* Fixed the last file for tardis-sn#680

* Fixed two random indentation irregularities found upon review

* Update base.py

* Update base.py

* Update packet_source.py

Going through and writing documentation guidelines, noticed that the carriage returns at line 450 and 456 were missing somehow, most likely from me missing them. I added those two carriage returns to make them consistent with the rest of the docstrings.
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this issue Oct 1, 2021
* Fixed to the montecarlo_numba file to compy w/ issue tardis-sn#680

* Fixed the latex equation

* Trying to fix merge conflict

* revert to conf.py

* Remove extra carriage return

* Update tardis/io/decay.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update decay.py

* Update interaction.py

* Update tardis/plasma/properties/atomic.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update single_packet_loop.py

* Update atomic.py

Fixed the formatting in regards to @jalahdh-singhal 's comments

* Update numba_interface.py

Changed the numba.array to numba.ndarray

* Update r_packet.py

Changed the r_packet type from RPacket to tardis.montecarlo.montecarlo_numba.r_packet.RPacket

* Update ion_population.py

Changed the Pandas DataFrame to pandas.DataFrame, and Numpy Array to numpy.ndarray. Made sure that the indentation was consistent as well.

* Update atomic.py

Changed to Pandas DataFrame/Series/MultiIndex to be pandas.DataFrame/Series/MultiIndex. Also changed the numpy descriptor to numpy.ndarray, and for now moved the type as a comment.

* fixing merge conflicts

* Changed the returns to fit what type they are

Returns were mostly in : descriptor. Changed them to just be what type, which they are pandas.DataFrame as seen from the inheritance of the class IsotopeAbundances.

* Modification to docstrings and addressing comments

* Update base.py

Removed trailing carriage returns on docstrings

* Update interaction.py

Naming the variables by their full extensions, not just the class that they are.

* Update macro_atom.py

Added the whole path (.NumbaPlasma) to the end of the description so the entire path is present.

* Update r_packet.py

Made the complete path for variables

* Update atomic.py

Updated the descriptions to try and match comments. Fixed the descriptors for the numpy.ndarrays to make them in the same line.

* Update ion_population.py

Fixing the format of docstrings so that the dtype would be same line as the var : type

* Update docs/index.rst

Co-authored-by: Jaladh Singhal <[email protected]>

* Update tardis/plasma/properties/atomic.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update tardis/io/decay.py

Co-authored-by: Jaladh Singhal <[email protected]>

* Update decay.py

* Update r_packet.py

Co-authored-by: Jaladh Singhal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants