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

define decorator @preserve_signature #640

Merged

Conversation

rocco8773
Copy link
Member

Create a decorator for decorators, which preserves the signature of the function being wrapped such that IDE function parameter hints still work for the wrapped function (see issue #619).

This PR does the following:

  1. creates a sub-package plasmapy.utils.decorators to house various plasmapy decorators
  2. created the module plamsapy.utils.decorators.helpers.py as a place where miscellaneous decorators can be defined
  3. defined decorator preserve_signature (in helpers.py)
  4. covered preserve_signature with tests
  5. updated decorators check_quantity and check_relativistic to utilize preserve_signature
  6. added automodapi of plasmapy.utils.decorators to documentation file docs/utils/index.rst

rocco8773 and others added 30 commits May 8, 2019 11:32
* Add ExB drift

* Add force drift

* Cleanup code, fixup documentation

* Add examples

* Pep8 fixes

* @namurphy review fixes
* use pprint

* Improve plot legends

* pep8 fixes

I also need to trigger travis
The roadmap has been out of date for a while, and we decided that it
would be better to pull it out of the main repository so that it could
be updated and versioned separately.
* Remove obsolete top-level INSTALL.md file

We originally kept our installation directions in this file, but have
since moved the information to our docs directory.  We kept this file
in case it was linked to from anywhere else on the World Wide Web, but
it has been a long enough time that we can safely remove it.

* Update setup.cfg

* Update citation information

A recommended practice for scientific reproducibility is to cite the
specific version of software used for a project, and an established
practice is to cite a paper or informational resource that describes
it.  This commit updates CITATION.rst and the near-identical
docs/about/citation.rst to include both of these references.  We
previously decided to keep both of these files despite the duplication
to make it extra apparent how to cite PlasmaPy.

I changed plasmapy.__citation__ to be a list of DOI links, including
the standard reference from 2018 and version 0.2.0.  The metadata for
our releases on Zenodo could potentially change (for example, adding
the name of a contributor that wasn't known before), so a DOI is the
most robust way to go about it.

I reserved the DOI for version 0.2.0 on Zenodo, so the links to that
will not work yet.
* README

* Improved readme

* add feedback form link

* Add communication info to documentation
* post v0.2.0 cleanup

* Update version in docs
update master from PlasmaPy master
@pep8speaks
Copy link

pep8speaks commented Jun 12, 2019

Hello @rocco8773! Thanks for updating your pull request.

Congratulations! There are no PEP8 issues in this pull request. 😸

Comment last updated at 2019-06-12 00:36:40 UTC

@codecov
Copy link

codecov bot commented Jun 12, 2019

Codecov Report

Merging #640 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #640      +/-   ##
==========================================
+ Coverage    96.5%   96.51%   +<.01%     
==========================================
  Files          52       54       +2     
  Lines        4551     4561      +10     
==========================================
+ Hits         4392     4402      +10     
  Misses        159      159
Impacted Files Coverage Δ
plasmapy/utils/checks.py 99.16% <100%> (-0.04%) ⬇️
plasmapy/utils/decorators/helpers.py 100% <100%> (ø)
plasmapy/utils/decorators/__init__.py 100% <100%> (ø)
plasmapy/utils/__init__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6afe25f...ed1233a. Read the comment docs.

Copy link
Member

@StanczakDominik StanczakDominik left a comment

Choose a reason for hiding this comment

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

The code looks neat! The commit history looks like a rebase gone wrong, though. I can deal with that if you'd like - though I think we might as well just squash this onto master.

Thanks for doing this! :)

@@ -1,8 +1,16 @@
"""
Package of functions and classes used to develop clean, readable, and informative
code.
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@rocco8773
Copy link
Member Author

@StanczakDominik It is a rebase gone wrong. It happened when I brought PlasmaPy/master into my fork. I'm not exactly sure what happened. If it's easy enough to just squash this onto master, then 👍.

@StanczakDominik StanczakDominik merged commit 762f5f3 into PlasmaPy:master Jun 12, 2019
@rocco8773 rocco8773 deleted the decorator_preserve_signature branch June 13, 2019 21:42
@namurphy namurphy added the plasmapy.utils Related to the plasmapy.utils subpackage label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plasmapy.utils Related to the plasmapy.utils subpackage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants