pybamm-team / PyBaMM

Fast and flexible physics-based battery models in Python
https://www.pybamm.org/
BSD 3-Clause "New" or "Revised" License
1.12k stars 548 forks source link

Better option checking #3303

Open rtimms opened 1 year ago

rtimms commented 1 year ago

The options checking doesn't always work as expected when options are tuples. For example, the following code performs checks if the option "particle size" is "distribution", but "particle size" can be a tuple, in which case the test doesn't run

        if options["particle size"] == "distribution":
            if options["lithium plating"] != "none":
                raise NotImplementedError(
                    "Lithium plating submodels do not yet support particle-size "
                    "distributions."
                )

The options should be converted to tuples first (where appropriate) and then checks performed on each index.

Saswatsusmoy commented 1 year ago

Can i get the path for the same code?

Saswatsusmoy commented 1 year ago

@rtimms Can you please review this and let me know if any more changes are required in the code.