From 9e2a6f12999e0442a84e5fe2c0891035433ccab3 Mon Sep 17 00:00:00 2001 From: Valentin Sulzer Date: Mon, 1 May 2023 11:30:43 -0400 Subject: [PATCH] #2908 revert citations tag --- CHANGELOG.md | 12 +++- CITATION.cff | 2 +- docs/conf.py | 2 +- docs/source/_static/versions.json | 2 +- pybamm/citations.py | 91 ++----------------------------- pybamm/version.py | 2 +- scripts/update_version.py | 10 +--- tests/unit/test_citations.py | 44 +-------------- vcpkg.json | 2 +- 9 files changed, 23 insertions(+), 144 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c5cf2264..25a266d54a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,21 @@ # [Unreleased](https://github.com/pybamm-team/PyBaMM/) +# [v23.4.1](https://github.com/pybamm-team/PyBaMM/tree/v23.4) - 2023-05-01 + +## Bug fixes + +- Fixed a performance regression introduced by citation tags ([#2862](https://github.com/pybamm-team/PyBaMM/pull/2862)). Citations tags functionality is removed for now. + # [v23.4](https://github.com/pybamm-team/PyBaMM/tree/v23.4) - 2023-04-30 -# Features +## Features - Added verbose logging to `pybamm.print_citations()` and citation tags for the `pybamm.Citations` class so that users can now see where the citations were registered when running simulations ([#2862](https://github.com/pybamm-team/PyBaMM/pull/2862)) - PyBaMM is now natively supported on Apple silicon chips (`M1/M2`) ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) - PyBaMM is now supported on Python `3.10` and `3.11` ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) - Updated to casadi 3.6, which required some changes to the casadi integrator. ([#2859](https://github.com/pybamm-team/PyBaMM/pull/2859)) -# Optimizations +## Optimizations - Fixed deprecated `interp2d` method by switching to `xarray.DataArray` as the backend for `ProcessedVariable` ([#2907](https://github.com/pybamm-team/PyBaMM/pull/2907)) @@ -19,7 +25,7 @@ - Fixed a bug in the discretisation of initial conditions of a scaled variable ([#2856](https://github.com/pybamm-team/PyBaMM/pull/2856)) - Fixed keyerror on "all" when getting sensitivities from IDAKLU solver([#2883](https://github.com/pybamm-team/PyBaMM/pull/2883)) -# Breaking changes +## Breaking changes - Made `Jupyter` a development only dependency. Now `Jupyter` would not be a required dependency for users while installing `PyBaMM`. ([#2846](https://github.com/pybamm-team/PyBaMM/pull/2846)) diff --git a/CITATION.cff b/CITATION.cff index d1443f50da..d62ec88040 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -24,6 +24,6 @@ keywords: - "expression tree" - "python" - "symbolic differentiation" -version: "23.4" +version: "23.4.1" repository-code: "https://github.com/pybamm-team/PyBaMM" title: "Python Battery Mathematical Modelling (PyBaMM)" diff --git a/docs/conf.py b/docs/conf.py index 3998ad1a22..04ff3ef211 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ author = "The PyBaMM Team" # The short X.Y version -version = "23.4" +version = pybamm.__version__ # The full version, including alpha/beta/rc tags release = version diff --git a/docs/source/_static/versions.json b/docs/source/_static/versions.json index 6f0f448c54..9187da4350 100644 --- a/docs/source/_static/versions.json +++ b/docs/source/_static/versions.json @@ -1 +1 @@ -[{"name": "latest", "version": "latest", "url": "https://pybamm.readthedocs.io/en/latest/"}, {"name": "stable", "version": "stable", "url": "https://pybamm.readthedocs.io/en/stable/"}, {"version": "v23.4", "url": "https://pybamm.readthedocs.io/en/v23.4/"}, {"version": "v23.3", "url": "https://pybamm.readthedocs.io/en/v23.3/"}, {"version": "v23.2", "url": "https://pybamm.readthedocs.io/en/v23.2/"}, {"version": "v23.1", "url": "https://pybamm.readthedocs.io/en/v23.1/"}, {"version": "v22.12", "url": "https://pybamm.readthedocs.io/en/v22.12/"}, {"version": "v22.11.1", "url": "https://pybamm.readthedocs.io/en/v22.11.1/"}, {"version": "v22.11", "url": "https://pybamm.readthedocs.io/en/v22.11/"}, {"version": "v22.10", "url": "https://pybamm.readthedocs.io/en/v22.10/"}, {"version": "v22.9", "url": "https://pybamm.readthedocs.io/en/v22.9/"}, {"version": "v22.8", "url": "https://pybamm.readthedocs.io/en/v22.8/"}, {"version": "v22.7", "url": "https://pybamm.readthedocs.io/en/v22.7/"}, {"version": "v22.6", "url": "https://pybamm.readthedocs.io/en/v22.6/"}, {"version": "v22.5", "url": "https://pybamm.readthedocs.io/en/v22.5/"}, {"version": "v22.4", "url": "https://pybamm.readthedocs.io/en/v22.4/"}, {"version": "v22.3", "url": "https://pybamm.readthedocs.io/en/v22.3/"}, {"version": "v22.2", "url": "https://pybamm.readthedocs.io/en/v22.3/"}, {"version": "v22.1", "url": "https://pybamm.readthedocs.io/en/v22.1/"}, {"version": "v21.12", "url": "https://pybamm.readthedocs.io/en/v21.12/"}, {"version": "v21.11", "url": "https://pybamm.readthedocs.io/en/v21.11/"}, {"version": "v21.10", "url": "https://pybamm.readthedocs.io/en/v21.10/"}, {"version": "v21.9", "url": "https://pybamm.readthedocs.io/en/v21.9/"}, {"version": "v21.08", "url": "https://pybamm.readthedocs.io/en/v21.08/"}, {"version": "v0.4.0", "url": "https://pybamm.readthedocs.io/en/v0.4.0/"}, {"version": "v0.3.0", "url": "https://pybamm.readthedocs.io/en/v0.3.0/"}, {"version": "v0.2.3", "url": "https://pybamm.readthedocs.io/en/v0.2.3/"}, {"version": "v0.2.2", "url": "https://pybamm.readthedocs.io/en/v0.2.2/"}, {"version": "v0.2.1", "url": "https://pybamm.readthedocs.io/en/v0.2.1/"}, {"version": "v0.2.0", "url": "https://pybamm.readthedocs.io/en/v0.2.0/"}, {"version": "v0.1.0", "url": "https://pybamm.readthedocs.io/en/v0.1.0/"}] \ No newline at end of file +[{"name": "latest", "version": "latest", "url": "https://pybamm.readthedocs.io/en/latest/"}, {"name": "stable", "version": "stable", "url": "https://pybamm.readthedocs.io/en/stable/"}, {"version": "v23.4.1", "url": "https://pybamm.readthedocs.io/en/v23.4.1/"}, {"version": "v23.4", "url": "https://pybamm.readthedocs.io/en/v23.4/"}, {"version": "v23.3", "url": "https://pybamm.readthedocs.io/en/v23.3/"}, {"version": "v23.2", "url": "https://pybamm.readthedocs.io/en/v23.2/"}, {"version": "v23.1", "url": "https://pybamm.readthedocs.io/en/v23.1/"}, {"version": "v22.12", "url": "https://pybamm.readthedocs.io/en/v22.12/"}, {"version": "v22.11.1", "url": "https://pybamm.readthedocs.io/en/v22.11.1/"}, {"version": "v22.11", "url": "https://pybamm.readthedocs.io/en/v22.11/"}, {"version": "v22.10", "url": "https://pybamm.readthedocs.io/en/v22.10/"}, {"version": "v22.9", "url": "https://pybamm.readthedocs.io/en/v22.9/"}, {"version": "v22.8", "url": "https://pybamm.readthedocs.io/en/v22.8/"}, {"version": "v22.7", "url": "https://pybamm.readthedocs.io/en/v22.7/"}, {"version": "v22.6", "url": "https://pybamm.readthedocs.io/en/v22.6/"}, {"version": "v22.5", "url": "https://pybamm.readthedocs.io/en/v22.5/"}, {"version": "v22.4", "url": "https://pybamm.readthedocs.io/en/v22.4/"}, {"version": "v22.3", "url": "https://pybamm.readthedocs.io/en/v22.3/"}, {"version": "v22.2", "url": "https://pybamm.readthedocs.io/en/v22.3/"}, {"version": "v22.1", "url": "https://pybamm.readthedocs.io/en/v22.1/"}, {"version": "v21.12", "url": "https://pybamm.readthedocs.io/en/v21.12/"}, {"version": "v21.11", "url": "https://pybamm.readthedocs.io/en/v21.11/"}, {"version": "v21.10", "url": "https://pybamm.readthedocs.io/en/v21.10/"}, {"version": "v21.9", "url": "https://pybamm.readthedocs.io/en/v21.9/"}, {"version": "v21.08", "url": "https://pybamm.readthedocs.io/en/v21.08/"}, {"version": "v0.4.0", "url": "https://pybamm.readthedocs.io/en/v0.4.0/"}, {"version": "v0.3.0", "url": "https://pybamm.readthedocs.io/en/v0.3.0/"}, {"version": "v0.2.3", "url": "https://pybamm.readthedocs.io/en/v0.2.3/"}, {"version": "v0.2.2", "url": "https://pybamm.readthedocs.io/en/v0.2.2/"}, {"version": "v0.2.1", "url": "https://pybamm.readthedocs.io/en/v0.2.1/"}, {"version": "v0.2.0", "url": "https://pybamm.readthedocs.io/en/v0.2.0/"}, {"version": "v0.1.0", "url": "https://pybamm.readthedocs.io/en/v0.1.0/"}] \ No newline at end of file diff --git a/pybamm/citations.py b/pybamm/citations.py index f3f4ed06e0..f236da8d71 100644 --- a/pybamm/citations.py +++ b/pybamm/citations.py @@ -7,7 +7,6 @@ import os import warnings import pybtex -from inspect import stack from pybtex.database import parse_file, parse_string, Entry from pybtex.scanner import PybtexError @@ -36,9 +35,6 @@ def __init__(self): # Dict mapping citations keys to BibTex entries self._all_citations: dict[str, str] = dict() - # Dict mapping citation tags for use when registering citations - self._citation_tags = dict() - # store citation error self._citation_err_msg = None @@ -52,21 +48,10 @@ def _reset(self): """Reset citations to default only (only for testing purposes)""" # Initialize empty papers to cite self._papers_to_cite = set() - # Initialize empty citation tags - self._citation_tags = dict() # Register the PyBaMM paper and the numpy paper self.register("Sulzer2021") self.register("Harris2020") - def _caller_name(): - """ - Returns the qualified name of classes that call :meth:`register` internally. - This is used for tagging citations but only for verbose output - """ - # Attributed to https://stackoverflow.com/a/17065634 - caller_name = stack()[2][0].f_locals["self"].__class__.__qualname__ - return caller_name - def read_citations(self): """Reads the citations in `pybamm.CITATIONS.txt`. Other works can be cited by passing a BibTeX citation to :meth:`register`. @@ -93,14 +78,6 @@ def _add_citation(self, key, entry): # Add to database self._all_citations[key] = new_citation - def _add_citation_tag(self, key, entry): - """Adds a tag for a citation key which represents the name of the class that - called :meth:`register`""" - - # Add a citation tag to the citation_tags ordered dictionary with - # the key being the citation itself and the value being the name of the class - self._citation_tags[key] = entry - @property def _cited(self): """Return a list of the BibTeX entries that have been cited""" @@ -124,14 +101,6 @@ def register(self, key): # Check if citation is a known key if key in self._all_citations: self._papers_to_cite.add(key) - # Add citation tags for the key - # This is used for verbose output - try: - caller = Citations._caller_name() - self._add_citation_tag(key, entry=caller) - # Don't add citation tags if the citation is registered manually - except KeyError: # pragma: no cover - pass return # Try to parse the citation using pybtex @@ -150,54 +119,14 @@ def register(self, key): # Unable to parse / unknown key raise KeyError(f"Not a bibtex citation or known citation: {key}") - def tag_citations(self): # pragma: no cover - """Prints the citations tags for the citations that have been registered - (non-manually). This is used for verbose output when printing citations - such that it can be seen which citations were registered by PyBaMM classes. - - To use, either call :meth:`tag_citations` after calling :meth:`register` - for all citations, or enable verbose output with :meth:`print_citations` - or :meth:`print`. - - .. note:: - If a citation is registered manually, it will not be tagged. - - Examples - -------- - .. code-block:: python - :linenos: - - pybamm.citations.register("Doyle1993") - pybamm.citations.print() or pybamm.print_citations() - - will print the following: - - .. code-block:: - - Citations registered: - Sulzer2021 was cited due to the use of - pybamm.models.full_battery_models.lithium_ion.dfn - - """ - if self._citation_tags: - print("\n Citations registered: \n") - for key, entry in self._citation_tags.items(): - print(f"{key} was cited due to the use of {entry}") - - def print(self, filename=None, output_format="text", verbose=False): - """Print all citations that were used for running simulations. The verbose - option is provided to print the citation tags for the citations that have - been registered non-manually. This is available only upon printing - to the terminal. + def print(self, filename=None, output_format="text"): + """Print all citations that were used for running simulations. Parameters ---------- filename : str, optional - Filename to which to print citations. If None, citations are printed - to the terminal. - verbose: bool, optional - If True, prints the citation tags for the citations that have been - registered + Filename to which to print citations. If None, citations are printed to the + terminal. """ if output_format == "text": citations = pybtex.format_from_strings( @@ -213,14 +142,12 @@ def print(self, filename=None, output_format="text", verbose=False): if filename is None: print(citations) - if verbose: - self.tag_citations() # pragma: no cover else: with open(filename, "w") as f: f.write(citations) -def print_citations(filename=None, output_format="text", verbose=False): +def print_citations(filename=None, output_format="text"): """See :meth:`Citations.print`""" if citations._citation_err_msg is not None: raise ImportError( @@ -232,13 +159,7 @@ def print_citations(filename=None, output_format="text", verbose=False): f"{citations._citation_err_msg}" ) else: - if verbose: # pragma: no cover - warnings.warn( - "Verbose output is not available for printing to files, only to the terminal" # noqa: E501 - ) - pybamm.citations.print(filename, output_format, verbose=True) - else: - pybamm.citations.print(filename, output_format) + pybamm.citations.print(filename, output_format) citations = Citations() diff --git a/pybamm/version.py b/pybamm/version.py index 22f8f46f42..0df16ace7c 100644 --- a/pybamm/version.py +++ b/pybamm/version.py @@ -1 +1 @@ -__version__ = "23.4" +__version__ = "23.4.1" diff --git a/scripts/update_version.py b/scripts/update_version.py index 9fc7569372..807db57fa2 100644 --- a/scripts/update_version.py +++ b/scripts/update_version.py @@ -32,14 +32,6 @@ def update_version(): file.seek(0) file.write(replace_version) - # docs/conf.py - with open(os.path.join(pybamm.root_dir(), "docs", "conf.py"), "r+") as file: - output = file.read() - replace_version = re.sub('(?<=version = ")(.+)(?=")', release_version, output) - file.truncate(0) - file.seek(0) - file.write(replace_version) - # CITATION.cff with open(os.path.join(pybamm.root_dir(), "CITATION.cff"), "r+") as file: output = file.read() @@ -64,7 +56,7 @@ def update_version(): ) # noqa: E501 file.truncate(0) file.seek(0) - file.write(json.dumps(json_data)) + file.write(json.dumps(json_data, indent=4)) # vcpkg.json with open(os.path.join(pybamm.root_dir(), "vcpkg.json"), "r+") as file: diff --git a/tests/unit/test_citations.py b/tests/unit/test_citations.py index e76d6b7566..5480182e6b 100644 --- a/tests/unit/test_citations.py +++ b/tests/unit/test_citations.py @@ -1,7 +1,6 @@ # # Tests the citations class. # -from tests import TestCase import pybamm import os import io @@ -14,7 +13,7 @@ @contextlib.contextmanager def temporary_filename(): - """Create a temporary-file and return yield its filename""" + """Create a temporary-file and return yield it's filename""" f = NamedTemporaryFile(delete=False) try: @@ -24,7 +23,7 @@ def temporary_filename(): os.remove(f.name) -class TestCitations(TestCase): +class TestCitations(unittest.TestCase): def test_citations(self): citations = pybamm.citations # Default papers should be in both _all_citations dict and in the papers to cite @@ -117,7 +116,6 @@ def test_marquis_2019(self): self.assertNotIn("Marquis2019", citations._papers_to_cite) pybamm.lithium_ion.SPM(build=False) self.assertIn("Marquis2019", citations._papers_to_cite) - self.assertIn("Marquis2019", citations._citation_tags.keys()) citations._reset() pybamm.lithium_ion.SPMe(build=False) @@ -129,7 +127,6 @@ def test_doyle_1993(self): self.assertNotIn("Doyle1993", citations._papers_to_cite) pybamm.lithium_ion.DFN(build=False) self.assertIn("Doyle1993", citations._papers_to_cite) - self.assertIn("Doyle1993", citations._citation_tags.keys()) def test_sulzer_2019(self): # Test that calling relevant bits of code adds the right paper to citations @@ -139,12 +136,10 @@ def test_sulzer_2019(self): self.assertNotIn("Sulzer2019asymptotic", citations._papers_to_cite) pybamm.lead_acid.LOQS(build=False) self.assertIn("Sulzer2019asymptotic", citations._papers_to_cite) - self.assertIn("Sulzer2019asymptotic", citations._citation_tags.keys()) citations._reset() pybamm.lead_acid.Full(build=False) self.assertIn("Sulzer2019physical", citations._papers_to_cite) - self.assertIn("Sulzer2019physical", citations._citation_tags.keys()) def test_timms_2021(self): # Test that calling relevant bits of code adds the right paper to citations @@ -154,43 +149,36 @@ def test_timms_2021(self): self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.current_collector.BasePotentialPair(param=None) self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.current_collector.EffectiveResistance() self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.current_collector.AlternativeEffectiveResistance2D() self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.thermal.pouch_cell.CurrentCollector1D(param=None) self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.thermal.pouch_cell.CurrentCollector2D(param=None) self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.thermal.Lumped(param=None) self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Timms2021", citations._papers_to_cite) pybamm.thermal.OneDimensionalX(param=None) self.assertIn("Timms2021", citations._papers_to_cite) - self.assertIn("Timms2021", citations._citation_tags.keys()) def test_subramanian_2005(self): # Test that calling relevant bits of code adds the right paper to citations @@ -202,7 +190,6 @@ def test_subramanian_2005(self): None, "negative", {"particle": "quadratic profile"}, "primary" ) self.assertIn("Subramanian2005", citations._papers_to_cite) - self.assertIn("Subramanian2005", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Subramanian2005", citations._papers_to_cite) @@ -210,7 +197,6 @@ def test_subramanian_2005(self): None, "negative", {"particle": "quadratic profile"}, "primary" ) self.assertIn("Subramanian2005", citations._papers_to_cite) - self.assertIn("Subramanian2005", citations._citation_tags.keys()) def test_brosaplanella_2021(self): # Test that calling relevant bits of code adds the right paper to citations @@ -220,7 +206,6 @@ def test_brosaplanella_2021(self): self.assertNotIn("BrosaPlanella2021", citations._papers_to_cite) pybamm.electrolyte_conductivity.Integrated(None) self.assertIn("BrosaPlanella2021", citations._papers_to_cite) - self.assertIn("BrosaPlanella2021", citations._citation_tags.keys()) def test_brosaplanella_2022(self): # Test that calling relevant bits of code adds the right paper to citations @@ -250,7 +235,6 @@ def test_brosaplanella_2022(self): build=False, options={"lithium plating": "irreversible"} ) self.assertIn("BrosaPlanella2022", citations._papers_to_cite) - self.assertIn("BrosaPlanella2022", citations._citation_tags.keys()) citations._reset() def test_newman_tobias(self): @@ -262,9 +246,7 @@ def test_newman_tobias(self): self.assertNotIn("Chu2020", citations._papers_to_cite) pybamm.lithium_ion.NewmanTobias() self.assertIn("Newman1962", citations._papers_to_cite) - self.assertIn("Newman1962", citations._citation_tags.keys()) self.assertIn("Chu2020", citations._papers_to_cite) - self.assertIn("Chu2020", citations._citation_tags.keys()) def test_scikit_fem(self): citations = pybamm.citations @@ -273,7 +255,6 @@ def test_scikit_fem(self): self.assertNotIn("Gustafsson2020", citations._papers_to_cite) pybamm.ScikitFiniteElement() self.assertIn("Gustafsson2020", citations._papers_to_cite) - self.assertIn("Gustafsson2020", citations._citation_tags.keys()) def test_reniers_2019(self): # Test that calling relevant bits of code adds the right paper to citations @@ -283,7 +264,6 @@ def test_reniers_2019(self): self.assertNotIn("Reniers2019", citations._papers_to_cite) pybamm.active_material.LossActiveMaterial(None, "negative", None, True) self.assertIn("Reniers2019", citations._papers_to_cite) - self.assertIn("Reniers2019", citations._citation_tags.keys()) def test_mohtat_2019(self): citations = pybamm.citations @@ -294,7 +274,6 @@ def test_mohtat_2019(self): pybamm.ParameterValues("Marquis2019") )._get_electrode_soh_sims_full() self.assertIn("Mohtat2019", citations._papers_to_cite) - self.assertIn("Mohtat2019", citations._citation_tags.keys()) def test_mohtat_2021(self): citations = pybamm.citations @@ -303,7 +282,6 @@ def test_mohtat_2021(self): self.assertNotIn("Mohtat2021", citations._papers_to_cite) pybamm.external_circuit.CCCVFunctionControl(None, None) self.assertIn("Mohtat2021", citations._papers_to_cite) - self.assertIn("Mohtat2021", citations._citation_tags.keys()) def test_sripad_2020(self): citations = pybamm.citations @@ -312,13 +290,11 @@ def test_sripad_2020(self): self.assertNotIn("Sripad2020", citations._papers_to_cite) pybamm.kinetics.Marcus(None, None, None, None, None) self.assertIn("Sripad2020", citations._papers_to_cite) - self.assertIn("Sripad2020", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Sripad2020", citations._papers_to_cite) pybamm.kinetics.MarcusHushChidsey(None, None, None, None, None) self.assertIn("Sripad2020", citations._papers_to_cite) - self.assertIn("Sripad2020", citations._citation_tags.keys()) def test_parameter_citations(self): citations = pybamm.citations @@ -326,40 +302,30 @@ def test_parameter_citations(self): citations._reset() pybamm.ParameterValues("Chen2020") self.assertIn("Chen2020", citations._papers_to_cite) - self.assertIn("Chen2020", citations._citation_tags.keys()) citations._reset() pybamm.ParameterValues("NCA_Kim2011") self.assertIn("Kim2011", citations._papers_to_cite) - self.assertIn("Kim2011", citations._citation_tags.keys()) citations._reset() pybamm.ParameterValues("Marquis2019") self.assertIn("Marquis2019", citations._papers_to_cite) - self.assertIn("Marquis2019", citations._citation_tags.keys()) citations._reset() pybamm.ParameterValues("Sulzer2019") self.assertIn("Sulzer2019physical", citations._papers_to_cite) - self.assertIn("Sulzer2019physical", citations._citation_tags.keys()) citations._reset() pybamm.ParameterValues("Ecker2015") self.assertIn("Ecker2015i", citations._papers_to_cite) - self.assertIn("Ecker2015i", citations._citation_tags.keys()) self.assertIn("Ecker2015ii", citations._papers_to_cite) - self.assertIn("Ecker2015ii", citations._citation_tags.keys()) self.assertIn("Zhao2018", citations._papers_to_cite) - self.assertIn("Zhao2018", citations._citation_tags.keys()) self.assertIn("Hales2019", citations._papers_to_cite) - self.assertIn("Hales2019", citations._citation_tags.keys()) self.assertIn("Richardson2020", citations._papers_to_cite) - self.assertIn("Richardson2020", citations._citation_tags.keys()) citations._reset() pybamm.ParameterValues("ORegan2022") self.assertIn("ORegan2022", citations._papers_to_cite) - self.assertIn("ORegan2022", citations._citation_tags.keys()) def test_solver_citations(self): # Test that solving each solver adds the right citations @@ -369,33 +335,28 @@ def test_solver_citations(self): self.assertNotIn("Virtanen2020", citations._papers_to_cite) pybamm.ScipySolver() self.assertIn("Virtanen2020", citations._papers_to_cite) - self.assertIn("Virtanen2020", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Virtanen2020", citations._papers_to_cite) pybamm.AlgebraicSolver() self.assertIn("Virtanen2020", citations._papers_to_cite) - self.assertIn("Virtanen2020", citations._citation_tags.keys()) if pybamm.have_scikits_odes(): citations._reset() self.assertNotIn("Malengier2018", citations._papers_to_cite) pybamm.ScikitsOdeSolver() self.assertIn("Malengier2018", citations._papers_to_cite) - self.assertIn("Malengier2018", citations._citation_tags.keys()) citations._reset() self.assertNotIn("Malengier2018", citations._papers_to_cite) pybamm.ScikitsDaeSolver() self.assertIn("Malengier2018", citations._papers_to_cite) - self.assertIn("Malengier2018", citations._citation_tags.keys()) if pybamm.have_idaklu(): citations._reset() self.assertNotIn("Hindmarsh2005", citations._papers_to_cite) pybamm.IDAKLUSolver() self.assertIn("Hindmarsh2005", citations._papers_to_cite) - self.assertIn("Hindmarsh2005", citations._citation_tags.keys()) @unittest.skipIf(not pybamm.have_jax(), "jax or jaxlib is not installed") def test_jax_citations(self): @@ -404,7 +365,6 @@ def test_jax_citations(self): self.assertNotIn("jax2018", citations._papers_to_cite) pybamm.JaxSolver() self.assertIn("jax2018", citations._papers_to_cite) - self.assertIn("jax2018", citations._citation_tags.keys()) if __name__ == "__main__": diff --git a/vcpkg.json b/vcpkg.json index 76a4c13755..dfc6d2eeab 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "pybamm", - "version-string": "23.4", + "version-string": "23.4.1", "dependencies": [ "casadi", {