Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Remove the exact antlr4-python3-runtime==4.11.* pin

Aperta
#418 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by locating the dependency configuration containing antlr4-python3-runtime and the MuMoT call sites using SymPy's parse_latex. Run tests/test_symbolic_regression.py, then review the Greek-letter notebook, docs/MuMoTuserManual.ipynb, and the minimum_versions_job. Done means the dependency conflict is resolved while all listed parsing and compatibility checks still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Since #417, every MuMoT dependency is unpinned (lower bounds only) except antlr4-python3-runtime==4.11.*.

The pin is required, not a choice. MuMoT parses model definitions and parameter names with sympy.parsing.latex.parse_latex, whose default ANTLR backend ships a parser generated with ANTLR 4.11. The ANTLR Python runtime only works with parsers generated by the same major.minor version, so SymPy ≥ 1.12 raises ImportError: LaTeX parsing requires the antlr4 Python package ... version 4.11 with any other runtime.

As a result, MuMoT cannot be installed alongside packages that pin a different ANTLR runtime. For example, Hydra/OmegaConf require antlr4-python3-runtime==4.9.*, and pip will refuse to resolve the two together. The pin will also need bumping whenever SymPy regenerates its parser.

Possible approaches

  1. Use SymPy's Lark backend. parse_latex(s, backend='lark') is available from SymPy 1.13 and needs the pure-Python lark package instead of ANTLR. This would remove the ANTLR dependency entirely. However, the Lark grammar is newer and parses some inputs differently: subscripts, \emptyset, Greek letters, and implicit multiplication would all need checking against every model and parameter string MuMoT handles. A fallback could try ANTLR first if it is importable and the right version, else use Lark.
  2. Stop using a general LaTeX parser. MuMoT mostly parses symbol names (e.g. \alpha_\beta, r_{1}) and simple rate expressions. A small dedicated parser for that subset, in the spirit of mumot/_vendor/pydstool/_cst.py, would remove the dependency and be fully under MuMoT's control.
  3. Keep the pin but make it track whatever SymPy needs, e.g. by depending on the latex extra that newer SymPy versions may provide.

Testing any change

  • tests/test_symbolic_regression.py compares symbolic results against the previous release; it exercises model parsing for several models, including Greek letters, subscripts and constant reactants.
  • The test notebooks (in particular TestNotebooks/MiscTests/MuMoTtest_GreekLetters.ipynb) and docs/MuMoTuserManual.ipynb cover the user-facing syntax.
  • The minimum_versions_job CI job checks the oldest allowed versions of all dependencies.
Lingua principale
Python
Stelle
24
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DiODeProject/MuMoT

Tutte le issue di DiODeProject/MuMoT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.