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

Removing old arguments #3682

Merged
merged 8 commits into from
Jan 25, 2024
Merged

Conversation

kratman
Copy link
Contributor

@kratman kratman commented Jan 3, 2024

Description

These arguments have been deprecated for a while. I figured it would be better to remove them to reduce code and error handling.

Type of change

Minor cleanup.

  • 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 kratman self-assigned this Jan 3, 2024
Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c93570f) 99.59% compared to head (d101081) 99.59%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3682   +/-   ##
========================================
  Coverage    99.59%   99.59%           
========================================
  Files          258      257    -1     
  Lines        20827    20796   -31     
========================================
- Hits         20742    20712   -30     
+ Misses          85       84    -1     

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

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Jan 3, 2024

Deprecated things are kept in the codebase for at least a year (at least three releases), are we in a position to remove these? I cannot exactly ascertain the duration from the git blame

@kratman
Copy link
Contributor Author

kratman commented Jan 3, 2024

Deprecated things are kept in the codebase for at least a year (at least three releases), are we in a position to remove these?

Is this documented somewhere? I don't think I have seen that rule and I could not find it with a text search in our guidelines.

I cannot exactly ascertain the duration from the git blame

The tests I removed were put in May 2023, so sometime around then.

@agriyakhetarpal
Copy link
Member

Deprecated things are kept in the codebase for at least a year (at least three releases), are we in a position to remove these?

Is this documented somewhere? I don't think I have seen that rule and I could not find it with a text search in our guidelines.

It's mentioned in the Versioning section of the README. I agree it's a bit difficult to find though and should be communicated more transparently in the Contributing Guide for developers and future contributors. Please feel free to add this note more explicitly at some place where you think it would be apt.

The tests I removed were put in May 2023, so sometime around then.

Ah I see, I don't have an opinion on this so I will leave it up to the others to see if removing it now should be fine, or we can come back to merging this PR later at the time of 24.5rc0

@agriyakhetarpal agriyakhetarpal requested a review from rtimms January 3, 2024 22:03
@rtimms
Copy link
Contributor

rtimms commented Jan 24, 2024

happy to merge this now and have it go in 24.5

@kratman
Copy link
Contributor Author

kratman commented Jan 24, 2024

happy to merge this now and have it go in 24.5

I will add the test and I also want to do a search for other outdated deprecation warnings. I will update soon

@agriyakhetarpal
Copy link
Member

Other deprecations that have to be removed from the codebase in v24.5 are all the entry points from pyproject.toml, with the exception of pybamm_install_odes

@kratman
Copy link
Contributor Author

kratman commented Jan 24, 2024

Other deprecations that have to be removed from the codebase in v24.5 are all the entry points from pyproject.toml, with the exception of pybamm_install_odes

@agriyakhetarpal Since you are more familiar with the entry points than I am, feel free to push that change to this branch.

Comment on lines +102 to +121
@staticmethod
def process_steps(unprocessed_steps, period, temp):
processed_steps = {}
for step in unprocessed_steps:
if repr(step) in processed_steps:
continue
elif isinstance(step, str):
processed_step = pybamm.step.string(step)
elif isinstance(step, pybamm.step._Step):
processed_step = step
else:
raise TypeError("Operating conditions must be a Step object or string.")

if processed_step.period is None:
processed_step.period = period
if processed_step.temperature is None:
processed_step.temperature = temp

processed_steps[repr(step)] = processed_step
return processed_steps
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rtimms I extracted this method so it was easily testable. I added a test for it.

@kratman kratman requested a review from rtimms January 24, 2024 18:40
@agriyakhetarpal
Copy link
Member

Actually, pybamm_install_jax was deprecated in v23.9, and therefore we must refrain from removing it until v24.9. I removed the command-line interface to the parameter sets in 42df246. It was deprecated in v22.10 and should have been removed by v24.1 – makes me realise we missed doing that.

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

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

thanks @kratman

@kratman kratman merged commit 00916f3 into pybamm-team:develop Jan 25, 2024
40 of 41 checks passed
@kratman kratman deleted the feat/removeOldArgs branch January 25, 2024 12:50
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
* Removing old arguments

* A couple extra fixes

* Removing more old warnings, tests failing

* Remove old tests

* Extract method and add a test

* Remove parameters CLI and associated files

---------

Co-authored-by: Agriya Khetarpal <[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.

3 participants