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

Issue 3392 improve documentation #3474

Conversation

AbhishekChaudharii
Copy link
Contributor

@AbhishekChaudharii AbhishekChaudharii commented Oct 26, 2023

Description

Added docstring to the print_parameter_info method.
Added information that arrays can be passed as values for drive cycles in Experiment steps
Related #3392

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

@kratman
Copy link
Contributor

kratman commented Oct 27, 2023

You should probably remove the "Fixes" line in your description since that keyword is intended to close the issue when the PR is merged. PR #3392 is supposed to be a long running issue, not just for this one line change.

Since you put parentheses around the issue number it will not automatically close it, but tou can change it to "Related #3392" to link it to the issue correctly without closing it.

@AbhishekChaudharii
Copy link
Contributor Author

Thank you for your feedback, I have changed fixes to related for now. After completing the second task i can use the Fixes Keyword right?

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e802b11) 99.58% compared to head (0aa0358) 99.58%.
Report is 20 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3474   +/-   ##
========================================
  Coverage    99.58%   99.58%           
========================================
  Files          257      257           
  Lines        20661    20661           
========================================
  Hits         20576    20576           
  Misses          85       85           

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

@brosaplanella
Copy link
Sponsor Member

Is this ready to review or still work in progress?

@AbhishekChaudharii
Copy link
Contributor Author

Hi @brosaplanella , I have done the changes you originally proposed. However while in the discussion on the issue @ejfdickinson proposed to remove detailed documentation for functions which are not suppose to be called by users and replace it with just the permitted value formats and kwargs. I haven't done that in this PR since I feel the current detailed documentation for the internal code will help assist future developers or maintainers to understand and debug the code

@kratman
Copy link
Contributor

kratman commented Nov 7, 2023

@AbhishekChaudharii If you think the additional changes will take a while, you can get this PR reviewed and merged. The remain changes can be done in a second PR

@@ -37,7 +37,7 @@ class _Step:
or "resistance".
value : float
The value of the step, corresponding to the type of step. Can be a number, a
2-tuple (for cccv_ode), or a 2-column array (for drive cycles)
2-tuple (for cccv_ode), or a 2-column array. Can pass list as argument (for drive cycles)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I don't think this argument can be a list, it has to be a 2-column array.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Just went to the original issue, the problem is that this comment that the value can be a 2-column array is not shown in the docs because it is not written in steps.py. So I would suggest reverting this change and adding the extra info in the docstrings of steps.py.

@AbhishekChaudharii
Copy link
Contributor Author

@brosaplanella I have completed the necessary changes, Can you please review it and if it's good to go, merge this PR so that I can get started on improving docs of User guide or API

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks better, just a small comment.

Comment on lines 123 to 124
The current value in A.
Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Suggested change
The current value in A.
Value can be a number, a 2-tuple (for cccv_ode), or a 2-column array (for drive cycles)
The current value in A. It can be a number or a 2-column array (for drive cycles)

The cccv_ode is only possible at the _Step level so does not need to be included here.

This applies to all below.

Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good thanks!

@brosaplanella
Copy link
Sponsor Member

@all-contributors please add @AbhishekChaudharii for documentation

Copy link
Contributor

@brosaplanella

I've put up a pull request to add @AbhishekChaudharii! 🎉

@brosaplanella brosaplanella merged commit 4fa8933 into pybamm-team:develop Dec 6, 2023
35 checks passed
@AbhishekChaudharii
Copy link
Contributor Author

@brosaplanella @kratman Thank you for helping me make my first contribution to open-source☺️

@AbhishekChaudharii AbhishekChaudharii deleted the issue_3392_improve_documentation branch December 8, 2023 07:27
@brosaplanella
Copy link
Sponsor Member

Thank you for contributing, and congratulations on your first contribution! Feel free to take any other unassigned issues if you wish to continue :)

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

3 participants