Releases: ComPWA/qrules
QRules 0.9.6
Release 0.9.6
See all documentation for this version here.
💡 New features
Topology is now ordered (#137)
This can be used to create a unique, deterministic ordered list of Topology instances. See ComPWA/ampform#6, where one needs a unique way of picking a reference topology.
Implemented Topology.relabel_edges() method (#138)
See how to use this method to permutate final state IDs in a Topology case here.
qrules.io.asdot() function now accepts Graphviz attributes (#139)
Accept Graphviz attributes in qrules.io.asdot(), so that the edges, nodes and overall DOT visualization of StateTransitions etc. can be styled. See here how to use.
Number of threads can now be set globally (#140)
Added a new class NumberOfThreads under the settings module that makes it possible to set the number of threads globally. This is mainly useful in the tests, where we want to run the StateTransitionManager single-threaded for test coverage (#11). Previously this was done by setting number_of_threads=1 in each test.
🐛 Bug fixes
Final state IDs in all StateTransitions match the order of the final_state argument in generate_transitions() (#145)
Closes #143
Compare this visualization in v0.9.5 with the one for this PR.
- 10379d2 adds a test that fails the check described in #143
- 2e91cb4 fixes that test
📝 Documentation
Default graphviz background is now transparent (#141)
Follow-up to #139. Consequence is that exported PNG and SVG files have no background. Preview here.
Get old behaviour with qrules.io.asdot(..., bgcolor="white").
Code examples are automatically linked to reference documentation (#147)
All code examples are now clickable with links to corresponding reference documentation (also external links APIs) with sphinx-codeautolink. Closes ComPWA/compwa.github.io#106
🖱️ Developer Experience
Changed upgrade cron job to bi-weekly (#135)
Installed jupyterlab-myst for MyST editing (#147)
Installed jupyterlab-myst
Updated black formatting style (#147)
Updated to the first non-beta black release 22.1.0. Most important style effect: no space around power operator **.
QRules 0.9.5
Release 0.9.5
See all documentation for this version here.
💡 New features
qrules.io.asdot() can now use with both render_node=True with strip_spin=True (#126)
This PR makes it possible to render StateTransitions with their node properties (render_node=True) and stripped spin projections. This is required for #124.
🔨 Internal maintenance
Importing qrules is now about 4x faster (#130)
See also ComPWA/tensorwaves#363
📝 Documentation
Links to Binder/Colab point to branch matching the version of the documentation (#121)
- docs: pin more intersphinx pages
- docs: remove tensorwaves from intersphinx mapping
- fix: exclude version 'module' from API
- refactor: get intersphinx version through function
- style: capitalize conf.py global vars that are no Sphinx options
- style: sort Sphinx options
LS-coupling is now illustrated in notebook (#124)
🖱️ Developer Experience
Run all notebooks with pytest (#129)
Run with tox -e nb or pytest --nbmake *.ipynb.
Upgrade to attrs new generation API (#129)
See ComPWA/compwa.github.io#90
This also allows upgrading to attrs v21.1, which has better support for pyright
https://www.attrs.org/en/stable/types.html#pyright
QRules 0.9.4
Release 0.9.4
See all documentation for this version here.
🐛 Bug fixes
Support typing-extensions v3.7 (#119)
Causes downstream problems with TensorFlow:
https://github.com/ComPWA/tensorwaves/runs/3996801941?check_suite_focus=true#step:9:9
QRules 0.9.3
Release 0.9.3
See all documentation for this version here.
💡 New features
Python 3.10 is now supported (#117)
🔨 Internal maintenance
Narrowed down type hints (#114)
- Improved some of the type hints
- Enforcing the use of mypy error codes (
# type: ignore[error-code]) with flake8-type-ignore.
See also ComPWA/ampform#168 and ComPWA/tensorwaves#332
📝 Documentation
🖱️ Developer Experience
Fixed .flake8 config syntax (#116)
The .flake8 config file was using not using the same comment style as described in
https://flake8.pycqa.org/en/latest/user/configuration.html#project-configuration
Consequence not all errors were identified anymore.
Additional update: config has been simplified with the use of --extend-select.
Embedded Zenodo metadata (#112)
Closes ComPWA/compwa.github.io#64
QRules 0.9.2
Release 0.9.2
See all documentation for this version here.
💡 New features
Added more pretty reprs through decorator (#85)
Following classes are now better represented in Jupyter noteboooks:
InitialFactsInteractionPropertiesEdgeSettingsNodeSettingsGraphSettingsGraphElementPropertiesQNProblemSetQuantumNumberSolutionQNResultExecutionInfo
Allow setting custom topologies in STM (#103)
Closes #96
Made the StateTransitionManager.topologies attribute public, so that it's easier to feed custom topologies to the StateTransitionManager. Note that the topologies attribute is immutable and can only be modified by overwriting it, so I decided to avoid cluttering the code with additional setters and getters.
An example for 2-to-2 topologies (see also #29) is illustrated in a new notebook.
🐛 Bug fixes
Use functools.wraps in decorators (b988057)
Improves the docstrings of decorated functions.
📝 Documentation
Removed references to the expert system in the documentation (#104)
Links in the documentation were sometimes still pointing to the expertsystem website. Best avoided by keeping intersphinx_mapping as small as possible.
Added conservation rules page (#84)
Describe how to use the conservation_rules module separately.
A preview with cell output can be viewed here:
https://qrules.readthedocs.io/en/doc-conservation-rules/usage/conservation.html
(until this PR is closed).
Decreased code line width in notebooks (#88)
Input code cells that are too wide get a scroll bar. That's ok, but it looks just a bit better when you can see the entire code without scrolling.
Page content on the documentation is now wider (#98)
Embedded GPLv3+ license file (#100)
Some platforms like Zenodo and conda-forge require the license file to be packaged.
Extended package description in README and removed tick-boxed (#101)
Removed the tick-boxes there, because they do not render correctly on PyPI.
Added package description for PyPI (#102)
Closes ComPWA/compwa.github.io#61
Automated changes by create-pull-request GitHub action
Removed references to the expert system in the documentation (#104)
Links in the documentation were sometimes still pointing to the expertsystem website. Best avoided by keeping intersphinx_mapping as small as possible.
Added a notebook that shows how to feed custom topologies to the StateTransitionManager (#103)
Closes #96
An example for 2-to-2 topologies (see also #29) is illustrated in a new notebook.
Switched to compwa-org web-page for contributing (#93)
🖱️ Developer Experience
Switched to pre-commit.ci where possible (#87)
pre-commit.ci is faster than GitHub Actions, so it would be better to switch to that. Another major advantage: it can auto-fix style problems.
The only problem is that hooks like pylint, mypy, and even flake8 require additional dependencies and we don't want to maintain a list of those in both setup.cfg (required for code editors that use those dependencies) as well as in .pre-commit-config.yaml. There are also hooks like pyright and editorconfig-checker that don't work well on pre-commit.ci.
This PR makes all hooks that don't require additional dependencies (like black and isort) 'non-local'. This also works better with source control in VSCode.
Caveat: pinned requirements might diverge from the versions of the hooks.
This PR is a bit experimental -- we'll have to see how well this works out before it is implemented in AmpForm etc.
Another potential problem is that (as far as I know), pre-commit.ci cannot switch off autoupdate (at most set to quarterly). It is (for now) better to upgrade the hooks along with the requirement pinning though.
🔨 Internal maintenance
Removed mdit-py-plugins version limit (#94)
QRules 0.9.1
Release 0.9.1
See all documentation for this version here.
⚠️ Interface
StateTransitionCollection ordered has become ordered (#77)
Turn StateTransitionCollection into an immutable abc.Sequence, instead of a set.
🐛 Bug fixes
Allow rendering iterables with graphviz (#78)
Allow converting an iterable (not just a sequence) to DOT. This enables rendering for instance the output of a filter as DOT:
import graphviz
import qrules
reaction = qrules.generate_transitions(
initial_state="J/psi(1S)",
final_state=["K0", "Sigma+", "p~"],
allowed_interaction_types="strong",
)
transitions = filter(
lambda t: t.states[3].particle.mass > 1.75,
reaction.transitions,
)
dot = qrules.io.asdot(transitions, collapse_graphs=True, render_final_state_id=False)
graphviz.Source(dot)Node properties for StateTransition are now also rendered (#80)
QRules 0.9.0
Release 0.9.0
‼ Contains major changes to qrules.generate_transitions
See all documentation for this version here.
💡 New features
Particles can now be sorted (#72)
This PR allows sorting Particle instances. This is useful later on in #26, when StateTransitions are meant to become frozen and sortable.
Note that ParticleCollection.names now returns a list, sorted using the total_ordering of Particle.
⚠️ Interface
Rename formalism_type to formalism (#69)
Use
result = qrules.generate_transitions(
....
formalism="canonical-helicity",
)instead of
result = qrules.generate_transitions(
....
formalism_type="canonical-helicity",
)Use canonical-helicity by default (#70)
Canonical is the most complete set of solutions. The idea is to do the formalism filtering later on, in AmpForm (see #12).
Return sorted list for ParticleCollection.names (#72)
ParticleCollection.names now returns a list, sorted using the total_ordering of Particle.
allowed_interaction_types has become more strict in what types of descriptions it takes (#74)
Simplifies the slightly confusing rules for the allowed_interaction_types argument of qrules.generate_transitions.
The Result class has been replaced with a frozen ReactionInfo class (#75)
Closes #26
A few new frozen classes (State, StateTransition, StateTransitionCollection, and ReactionInfo) now replace the StateTransitionGraph as main interface to the user. StateTransitionGraph is mutable and only for internal usage (see also #25).
The Result class has been removed in favor of ReactionInfo.
Some additional improvements:
TopologyandTopologynow have a pretty printer methods (as haveStateTransitionetc.)FrozenDicthas gotten ordering (for sortingStateTransitions andTopologys).
📝 Documentation
Documentation now uses import qrules without "as q" (#66)
Use import qrules instead of import qrules as q, as it's not really needed to abbreviate this module.
🔨 Internal maintenance
Result fixture in the conftest.py for the unit tests has been parametrized (#67)
repr methods in tests are parametrized (#68)
Also includes pytest-flake8 fixes
Fixed more problems identified by pytest-flake8 (#68)
See pytest-flake8
QRules 0.8.2
Release 0.8.2
See all documentation for this version here.
📝 Documentation
Improved docstrings about interaction properties (#57)
It's not well documented what the labels of an interaction node mean (see for instance this graph visualization).
Rendering of special methods in the API has also been improved.
🐛 Bug fixes
Refuse rendering collapsed graphs with node properties (#57)
It doesn't make sense to render node properties for collapsed graphs of state transition graphs without spin projections on the edges, so io.asdot now raises an exception if you try to use render_node=True with collapse_graph=True or strip_spin=True.
🖱️ Developer Experience
Milestone are now automatically closed upon release (#62)
QRules 0.8.1
Release 0.8.1
Maintenance release: mainly improves mobile version of the website.
See all documentation for this version here.
⚠️ Interface
Optional dependencies "extras" has been renamed to "all" (a2fc2dd)
🖱️ Developer Experience
Added PR template + gitpod extensions (#52)
GitPod now automatically installs recommended VSCode extensions (#52)
Notebooks can now be run through pytest (#53)
Provides a faster way of running all notebooks. Usage:
tox -e testnb
EXECUTE_NB=yes tox -e testnb # as if run by Sphinxor
poytest --nb-test-files # all tests and notebooks
pytest docs --nb-test-files
pytest docs --nb-test-files -n auto # parallelRest of the configuration, such as ignoring cell output, is provided through pytest.ini. For further info, see pytest-notebook.
Note that the notebooks are still run through Sphinx on the CI. This is to ensure the rendering on RTD works correctly. pytest-notebook is therefore only installed through the dev extras, not through the test extras.
Removed nbstripout from developer dependencies (c7c93f7)
Only available as pre-commit hook now.
Added more flake8 plugins and fixed identified problems (ffa91f5)
Added VSCode test explorer extension (2318823)
Native VSCode test explorer doesn't work as great. For instance, it's not possible to run all tests within a folder.
QRules 0.8.0
Release 0.8.0
See all documentation for this version here.
💡 New features
Determine quantum number domains from a ParticleCollection (#45)
From ComPWA/expertsystem#486, but adapted so that ranges are generated: if there is some Particle in the inserted ParticleCollection with spin-1.5, the range will be [0, 0.5, 1, 1.5] (not just [1.5]). Also allows setting the maximum spin in LS-couplings.
Extend configuration arguments in facade functions (#40) by @wgradl
Allow setting the maximum angular momentum and spin magnitude through check_reaction_violations() and generate_transitions().
⚠️ Interface
Rename default_settings to settings (#43)
Rename to InteractionTypes to InteractionType (#47)
Policy is that enums should be singular, so that the syntax makes more sense, especially in docstrings. For instance:
- "Which
InteractionType?" - "Use
InteractionType.WEAKinstead of..."
Same with the (already existing) SolvingMode.
Rename particles argument to particle_db in several functions (#50)
Rename particles argument to particle_db in several functions and classes, such as the StateTransitionManager. This naming was introduced for check_reaction_violations (#40) and makes more sense to the reader.
🐛 Bug fixes
Fix link to codacy badge (#4)
Define testpaths in pytest.ini (#42)
Since 8a3f33c, it is become impossible to run tests through VSCode. Defining testpaths in pytest.ini fixes this. In addition, it removes the last 'non-tox' section from the tox.ini file (see 2d9f620).
Note that this also allows running and debugging doctests from VScode 🎉
🔨 Internal maintenance
Added a test to verify default interaction settings (#41)
Taken from ComPWA/expertsystem#486 and in preparation of #40. The next step (before #40 idea is to deduce default interaction settings from a ParticleCollection (as was initially done in that PR, see ComPWA/expertsystem#486 (comment))
📝 Documentation
🖱️ Developer Experience
Split GitHub Actions workflow "CI" into CI-style, CI-docs, and CI-tests (#36)
Let Read the Docs fail if there are warning (#37)
Define all requirements setup.cfg and pin versions through constraint files (#39)
With the release of pip-tools v6.1.0, pip-compile now correctly handles extras_require. This allows for a big clean-up of the set-up introduced by ComPWA/expertsystem#412.
Advantages:
- Easier for the user and developer! Just run:
pip install -e .[dev]
to get started developing,
pip install -e .[dev] -U
to try out upgrades, and
pip install -c .constraints/py3.8.txt -e .[dev] -U
in case you exactly want to reproduce the dependencies for some commit. - The upgrade jobs become significantly faster: bit over 1min versus almost 3min
- All requirements, their version domains, and the dependencies between each of the requirement sections can be nicely overseen and maintained within
setup.cfg - Git diffs for pull requests that affect dependencies become easier to oversee
- Less complexity and fewer changes per commit
Define testpaths in pytest.ini (#42)
Since 8a3f33c, it is become impossible to run tests through VSCode. Defining testpaths in pytest.ini fixes this. In addition, it removes the last 'non-tox' section from the tox.ini file (see 2d9f620).
Note that this also allows running and debugging doctests from VScode 🎉