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

Make get_spatial_var private #3755

Merged
merged 8 commits into from
May 3, 2024

Conversation

Akhil-Sharma30
Copy link
Contributor

@Akhil-Sharma30 Akhil-Sharma30 commented Jan 21, 2024

Description

In this PR fixed the following bugs in pybamm.QuickPlot.py:

  1. pybamm.QuickPlot.create_gif removed the round brackets around the optional keyword.
  2. pybamm.QuickPlot.dynamic_plot made the Args as optional.
  3. pybamm.QuickPlot.get_spatial_var made private.
  4. pybamm.QuickPlot.plot Documented dynamic arg.

Fixes #3754

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ pre-commit run (or $ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ python run-tests.py --doctest (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ python run-tests.py --quick (or $ nox -s quick).

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.59%. Comparing base (33371b0) to head (ac4ec8c).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3755   +/-   ##
========================================
  Coverage    99.59%   99.59%           
========================================
  Files          259      259           
  Lines        21353    21353           
========================================
  Hits         21266    21266           
  Misses          87       87           

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

pybamm/plotting/quick_plot.py Outdated Show resolved Hide resolved
pybamm/plotting/quick_plot.py Outdated Show resolved Hide resolved
pybamm/plotting/quick_plot.py Outdated Show resolved Hide resolved
pybamm/plotting/quick_plot.py Outdated Show resolved Hide resolved
@agriyakhetarpal
Copy link
Member

  1. pybamm.QuickPlot.get_spatial_var made private.

This will require a note in the CHANGELOG too as a breaking change (even if this function was not being used by a lot of users)

@Akhil-Sharma30 Akhil-Sharma30 force-pushed the quick_plot_func_private branch from 4c04568 to 8d30042 Compare January 21, 2024 19:16
@Akhil-Sharma30
Copy link
Contributor Author

  1. pybamm.QuickPlot.get_spatial_var made private.

This will require a note in the CHANGELOG too as a breaking change (even if this function was not being used by a lot of users)

Added in the changelog.md

CHANGELOG.md Outdated Show resolved Hide resolved
@Akhil-Sharma30 Akhil-Sharma30 force-pushed the quick_plot_func_private branch from 31acde0 to ca49a51 Compare January 22, 2024 09:39
@kratman
Copy link
Contributor

kratman commented Jan 22, 2024

@Akhil-Sharma30 Just a note, I would suggest that you don't force push if you can avoid it. It overwrites history on git and makes it harder to see what was reviewed.

@Akhil-Sharma30
Copy link
Contributor Author

@Akhil-Sharma30 Just a note, I would suggest that you don't force push if you can avoid it. It overwrites history on git and makes it harder to see what was reviewed.

Okay sure I will take care of that in future.

@Saransh-cpp
Copy link
Member

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

See #3752 (review)

Could you please also change the PR title to reflect that this is deprecating something and not fixing a bug? Thanks!

@kratman
Copy link
Contributor

kratman commented Mar 7, 2024

@Akhil-Sharma30 Are you still working on this and #3752

@Akhil-Sharma30
Copy link
Contributor Author

@Akhil-Sharma30 Are you still working on this and #3752

Yes, I was busy with some other work.

@kratman
Copy link
Contributor

kratman commented Mar 25, 2024

@Saransh-cpp What is left on this one? Just deprecation warnings and changing the PR title?

@Saransh-cpp
Copy link
Member

And changelog, that should be it.

@arjxn-py
Copy link
Member

@Akhil-Sharma30 Are you still working on this?

@kratman kratman changed the title Fix the Bug in pybamm.QuickPlot.py Make get_spatial_var private May 3, 2024
Copy link
Contributor

@kratman kratman left a comment

Choose a reason for hiding this comment

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

The changes seem minor and since the function only appears in this file, I don't think the deprecation warning is needed

@kratman kratman dismissed Saransh-cpp’s stale review May 3, 2024 16:36

As far as I can tell the changes were made. We can open a new ticket for the deprecation warning if it is a major concern before the release. It seems like the function is not widely used, so it is probably not needed.

@kratman kratman merged commit febf1ac into pybamm-team:develop May 3, 2024
42 checks passed
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
* Make `get_spatial_var` private `quick_plot.py`

* Remove round brackets around optional keyword in `QuickPlot.create_gif`

* Make Args in `dynamic_plot` optional

* Document dynamic arg in `pybamm.QuickPlot.plot`

* Add `get_spatial_var` info in `breaking changes` inside `CHANGELOG.md`

---------

Co-authored-by: Robert Timms <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
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.

[Bug]: Fix the Bug in pybamm.QuickPlot.py file
6 participants