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

Implement discharge capacity as an optional x-axis in QuickPlot #4775

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

medha-14
Copy link
Contributor

Description

Fixes #1751

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 -m pytest (or $ nox -s tests)
  • The documentation builds: $ python -m pytest --doctest-plus src (or $ nox -s doctests)

You can run integration tests, unit tests, and doctests together at once, using $ 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

@medha-14
Copy link
Contributor Author

I have implemented the necessary changes for handling 0D variables. Once this is confirmed to be working correctly, I plan to work on handling 1D and 2D variables. Additionally, I have made changes in the dynamic plot, though I am unsure if they were necessary, so I would appreciate it if you could review them as well. Could you please suggest the next steps for moving forward?

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.71%. Comparing base (c9b5930) to head (a43388c).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4775   +/-   ##
========================================
  Coverage    98.71%   98.71%           
========================================
  Files          304      304           
  Lines        23495    23514   +19     
========================================
+ Hits         23192    23211   +19     
  Misses         303      303           

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

@medha-14
Copy link
Contributor Author

Hello @agriyakhetarpal could please give a review on this? :)

Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

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

Thanks, this is a good start.

Variables should always be evaluated with time, not discharge capacity.

Also, the implementation would be simpler if you just set self.x_axis, self.x_min and self.x_max once and used those everywhere, instead of having the if/else for time and discharge capacity in so many places

@medha-14
Copy link
Contributor Author

medha-14 commented Feb 5, 2025

Also, the implementation would be simpler if you just set self.x_axis, self.x_min and self.x_max once and used those everywhere, instead of having the if/else for time and discharge capacity in so many places

I have made the suggested changes, I would like a review on if the plot functionality is working correctly or do I have to make some other changes.

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

I think the change looks good, could you please add a test or two? I expect the coverage to go down as you have a few branches in the code now (i.e., one for time, and one for discharge capacity).

@medha-14
Copy link
Contributor Author

I think the change looks good, could you please add a test or two? I expect the coverage to go down as you have a few branches in the code now (i.e., one for time, and one for discharge capacity).

Do I also have to make similar changes for 1D and 2D variables? or are they simply not applicable in those cases?

@medha-14
Copy link
Contributor Author

For now I have added tests for the function , let me know if any other changes are to be made

Do I also have to make similar changes for 1D and 2D variables? or are they simply not applicable in those cases?

Also suggest how to move forward with this?

@agriyakhetarpal agriyakhetarpal self-requested a review February 11, 2025 04:38
Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

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

This is almost there, just a few more comments

@medha-14
Copy link
Contributor Author

I have made the suggested changes, if anyone could review this one :)

@agriyakhetarpal
Copy link
Member

It looks good to me, just three missing lines in the coverage. Thanks for your work!

@medha-14 medha-14 requested a review from a team as a code owner February 19, 2025 09:39
@medha-14
Copy link
Contributor Author

I have added tests for the missing lines, are there any other improvements I need to make ?

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Nice work, thanks, @medha-14! I am happy to approve this, though I'll also request @valentinsulzer for a review as he previously requested changes.

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.

Quickplot with discharge capacity as x axis
4 participants