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

Add parameters to statistics #886

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

p-glaum
Copy link
Contributor

@p-glaum p-glaum commented May 14, 2024

Similar to matplotlib where you can set rc parameters, this feature is implemented for statistics. With this PR you can set the parameter for rounding values, showing zero values and nice names in statistics. E.g., pypysa.statistics.set_parameters(nice_names=False) which then calls all statistics methods with the attribute nice_names set to False as default. Furthermore, you can see available groupers by calling statistics.groupers and the set parameters by calling statistics.parameters

Changes proposed in this Pull Request

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@p-glaum p-glaum marked this pull request as ready for review May 17, 2024 15:12
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 79.03%. Comparing base (cca33db) to head (74b2744).
Report is 4 commits behind head on master.

Files Patch % Lines
pypsa/statistics.py 84.61% 10 Missing and 4 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #886   +/-   ##
=======================================
  Coverage   79.03%   79.03%           
=======================================
  Files          23       23           
  Lines        4731     4770   +39     
  Branches      984      996   +12     
=======================================
+ Hits         3739     3770   +31     
- Misses        741      746    +5     
- Partials      251      254    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

1 participant