Skip to content

refactor: migrate citations.py from pybtex to bibtexparser #4974

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

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ce217d0
refactor: migrate citations.py from pybtex to bibtexparser
gurukiran7 Apr 15, 2025
05b9962
style: pre-commit fixes
pre-commit-ci[bot] Apr 15, 2025
d47b729
Added updates to test_citations.py and configuration changes in pypro…
gurukiran7 Apr 15, 2025
e4f7d3a
conflict resolved
gurukiran7 Apr 15, 2025
42ed0a8
style: pre-commit fixes
pre-commit-ci[bot] Apr 15, 2025
64c1d09
Remove unintended test_thermal_parameters.py file
gurukiran7 Apr 15, 2025
d4e72c8
style: pre-commit fixes
pre-commit-ci[bot] Apr 16, 2025
4ccbc90
Refactor citation output formatting and pin bibtexparser version
gurukiran7 Apr 16, 2025
6dd5f2c
Remove BibDatabase usage and update citation printing for bibtexparse…
gurukiran7 Apr 16, 2025
f9965f6
Merge branch 'newCitationParser' of https://github.com/gurukiran7/PyB…
gurukiran7 Apr 17, 2025
7f6dd57
Switched to bibtexparser v1 and updated code accordingly
gurukiran7 Apr 17, 2025
a9a2546
style: pre-commit fixes
pre-commit-ci[bot] Apr 17, 2025
10d1f10
Updated code to use bibtexparser==2.0.0b8, Switched from bibtexparser…
gurukiran7 Apr 17, 2025
688aae8
resolved conflicts
gurukiran7 Apr 17, 2025
f8728e1
style: pre-commit fixes
pre-commit-ci[bot] Apr 17, 2025
ccdc537
style: apply pre-commit auto-fixes
gurukiran7 Apr 18, 2025
fe673f5
style: apply ruff-format and B904 fix
gurukiran7 Apr 18, 2025
e67854a
fixed the conflict
gurukiran7 Apr 18, 2025
96617c0
resolve nox test issues by updating citation handling and test cases
gurukiran7 Apr 21, 2025
b93f19c
style: pre-commit fixes
pre-commit-ci[bot] Apr 21, 2025
5d2d286
resolve nox test issues by updating citation handling and test cases
gurukiran7 Apr 21, 2025
fe69b0f
Add .hypothesis/ to .gitignore
gurukiran7 Apr 21, 2025
8e2b866
Merge branch 'newCitationParser' of https://github.com/gurukiran7/PyB…
gurukiran7 Apr 21, 2025
c487cdd
style: pre-commit fixes
pre-commit-ci[bot] Apr 21, 2025
2f0c970
Remove .hypothesis/ files from the repository
gurukiran7 Apr 21, 2025
1faf48c
add bibtexparser to 'cite' extras for optional citation support
gurukiran7 Apr 23, 2025
7356e5d
Merge branch 'newCitationParser' of https://github.com/gurukiran7/PyB…
gurukiran7 Apr 23, 2025
91302c5
pdate bibtexparser v2 usage in print to remove add_entry call
gurukiran7 Apr 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gitignore
Binary file not shown.
17 changes: 9 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_coverage(session):
# Using plugin here since coverage runs unit tests on linux with latest python version.
if "CI" in os.environ:
session.install("pytest-github-actions-annotate-failures")
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("-e", ".[all,dev,jax,cite]", silent=False)
session.run("pytest", "--cov=pybamm", "--cov-report=xml", "tests/unit")


Expand All @@ -55,7 +55,7 @@ def run_integration(session):
and sys.platform == "linux"
):
session.install("pytest-github-actions-annotate-failures")
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("-e", ".[all,dev,jax,cite]", silent=False)
session.run("python", "-m", "pytest", "-m", "integration")


Expand All @@ -64,7 +64,7 @@ def run_doctests(session):
"""Run the doctests and generate the output(s) in the docs/build/ directory."""
# Fix for Python 3.12 CI. This can be removed after pybtex is replaced.
session.install("setuptools", silent=False)
session.install("-e", ".[all,dev,docs]", silent=False)
session.install("-e", ".[all,dev,docs,cite]", silent=False)
session.run(
"python",
"-m",
Expand All @@ -78,15 +78,16 @@ def run_doctests(session):
def run_unit(session):
"""Run the unit tests."""
set_environment_variables(PYBAMM_ENV, session=session)
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("bibtexparser==2.0.0b8")
session.install("-e", ".[all,dev,jax,cite]", silent=False)
session.run("python", "-m", "pytest", "-m", "unit")


@nox.session(name="examples")
def run_examples(session):
"""Run the examples tests for Jupyter notebooks."""
set_environment_variables(PYBAMM_ENV, session=session)
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("-e", ".[all,dev,jax,cite]", silent=False)
notebooks_to_test = session.posargs if session.posargs else []
session.run(
"pytest", "--nbmake", *notebooks_to_test, "docs/source/examples/", external=True
Expand All @@ -99,7 +100,7 @@ def run_scripts(session):
set_environment_variables(PYBAMM_ENV, session=session)
# Fix for Python 3.12 CI. This can be removed after pybtex is replaced.
session.install("setuptools", silent=False)
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("-e", ".[all,dev,jax,cite]", silent=False)
session.run("python", "-m", "pytest", "-m", "scripts")


Expand Down Expand Up @@ -130,7 +131,7 @@ def set_dev(session):
def run_tests(session):
"""Run the unit tests and integration tests sequentially."""
set_environment_variables(PYBAMM_ENV, session=session)
session.install("-e", ".[all,dev,jax]", silent=False)
session.install("-e", ".[all,dev,jax,cite]", silent=False)
session.run(
"python",
"-m",
Expand All @@ -145,7 +146,7 @@ def build_docs(session):
envbindir = session.bin
# Fix for Python 3.12 CI. This can be removed after pybtex is replaced.
session.install("setuptools", silent=False)
session.install("-e", ".[all,docs]", silent=False)
session.install("-e", ".[all,docs,cite]", silent=False)
session.chdir("docs")
# Local development
if session.interactive:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ plot = [
]
cite = [
"setuptools", # Fix for a pybtex issue
"pybtex>=0.24.0",
"bibtexparser==2.0.0b8"
]
# Battery Parameter eXchange format
bpx = [
Expand Down
Loading
Loading