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

Added 'operating mode' to the doc string of BaseBatteryModel class #1404

Conversation

Saransh-cpp
Copy link
Member

@Saransh-cpp Saransh-cpp commented Feb 26, 2021

Description

  1. Added description for 'operating mode' parameter in BaseBatteryModel class.
  2. Deleted '\' from some lines to format the displayed output. With '\', the output was behaving weirdly as displayed in the screenshot below (The line, where "average" is described, was breaking up with huge spaces in between).
    image

Please let me know if you want any changes or additions in the PR. Thanks!

Fixes #1388

Type of change

Doc string addition

  • 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
  • All tests pass
  • The documentation builds

Further checks:

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

@Saransh-cpp
Copy link
Member Author

Saransh-cpp commented Feb 26, 2021

Warning, treated as error:
/home/runner/work/PyBaMM/PyBaMM/pybamm/models/full_battery_models/base_battery_model.py:docstring of pybamm.models.full_battery_models.base_battery_model.BaseBatteryModel:98:Unexpected indentation.

Is this fail/error somehow related to the '\' I removed?

@priyanshuone6
Copy link
Member

I guess it might help

rst is quite picky about indentations in lists. You could try isolating the problem by commenting things out and running the local test. I think sometimes they want a \ at the end of the line in a list
Originally posted by @tinosulzer in #1386 (comment)

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 @Saransh-cpp , looks good once the tests pass

@Saransh-cpp
Copy link
Member Author

I guess it might help

rst is quite picky about indentations in lists. You could try isolating the problem by commenting things out and running the local test. I think sometimes they want a \ at the end of the line in a list
Originally posted by @tinosulzer in #1386 (comment)

Thanks! I will add the backslashes that were removed.

@valentinsulzer
Copy link
Member

I've just seen your coment about the huge spaces in the output - good catch. Would be good to figure out a way that doesn't have that problem. If it looks fine in the docs without the \ then maybe we can edit the doctest

@Saransh-cpp
Copy link
Member Author

Saransh-cpp commented Feb 26, 2021

I've just seen your coment about the huge spaces in the output - good catch. Would be good to figure out a way that doesn't have that problem. If it looks fine in the docs without the \ then maybe we can edit the doctest

Either I could have formatted the doc string to look good when it is displayed on the terminal or in the code base, I added all the '\'s to make it look good in the codebase. If you want then I can add an empty line after every backslash that is creating a problem (this will make the docstring look a bit weird in the codebase with extra empty lines), I tested this on my side and it outputs the docstring well formatted.

Edit: Yes it looks good without the backslashes, please let me know if I should make any changes. Thanks!

@codecov
Copy link

codecov bot commented Feb 26, 2021

Codecov Report

Merging #1404 (10a4d95) into develop (e1c7273) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1404   +/-   ##
========================================
  Coverage    98.22%   98.22%           
========================================
  Files          278      278           
  Lines        15806    15806           
========================================
  Hits         15526    15526           
  Misses         280      280           
Impacted Files Coverage Δ
...m/models/full_battery_models/base_battery_model.py 99.68% <ø> (ø)

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 e1c7273...72c6119. Read the comment docs.

@valentinsulzer
Copy link
Member

Let's keep the backslash, it looks fine here: https://pybamm.readthedocs.io/en/latest/source/models/base_models/base_battery_model.html

@valentinsulzer valentinsulzer merged commit 2c223ba into pybamm-team:develop Feb 26, 2021
@Saransh-cpp Saransh-cpp deleted the issue-1388-missing-operating-mode-from-docstring branch June 29, 2021 06:05
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.

Operating mode docs
3 participants