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

Misc. bug fixes #4581

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Misc. bug fixes #4581

merged 3 commits into from
Nov 12, 2024

Conversation

kratman
Copy link
Contributor

@kratman kratman commented Nov 12, 2024

Description

A couple minor bug fixes before the release

Fixes #4580
Fixes #4578

Type of change

  • 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
Contributor Author

@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.

Explanations

@@ -243,7 +243,7 @@ def update(self, values, check_conflict=False, check_already_exists=True, path="
f"Cannot update parameter '{name}' as it does not "
+ f"have a default value. ({err.args[0]}). If you are "
+ "sure you want to update this parameter, use "
+ "param.update({{name: value}}, check_already_exists=False)"
+ "param.update({name: value}, check_already_exists=False)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a mistake from when the f-strings were broken up

@@ -234,4 +235,4 @@
"pybamm_data",
]

pybamm.config.generate()
config.generate()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing it this way gets rid of an IDE warning

_posthog = Posthog(
# this is the public, write only API key, so it's ok to include it here
project_api_key="phc_bLZKBW03XjgiRhbWnPsnKPr0iw0z03fA6ZZYjxgW7ej",
host="https://us.i.posthog.com",
)

_posthog.log.setLevel("CRITICAL")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error from not being connected to the internet comes out at the ERROR level. This stops the warning as far as I can tell

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.27%. Comparing base (1022c6b) to head (2b548a3).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4581   +/-   ##
========================================
  Coverage    99.27%   99.27%           
========================================
  Files          302      302           
  Lines        22868    22870    +2     
========================================
+ Hits         22703    22705    +2     
  Misses         165      165           

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

@kratman kratman merged commit bf8f623 into pybamm-team:develop Nov 12, 2024
25 checks passed
@kratman kratman deleted the fix/bugFixes branch November 12, 2024 21:27
pkalbhor pushed a commit to pkalbhor/PyBaMM that referenced this pull request Nov 15, 2024
* Error message fix

* Fix logging error

* Remove blank line
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]: Error thrown when not connected to the internet Updating parameters without default values
2 participants