Qrules

Latest version: v0.10.5

Safety actively analyzes 707009 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.9.3

See all documentation for this version [here](https://qrules.rtfd.io/en/0.9.3).

💡 New features

<details>
<summary>Python 3.10 is now supported (117)</summary>



</details>


🔨 Internal maintenance

<details>
<summary>Narrowed down type hints (114)</summary>

* Improved some of the type hints
* Enforcing the use of [mypy error codes](https://mypy.readthedocs.io/en/stable/error_codes.html#silencing-errors-based-on-error-codes) (` type: ignore[error-code]`) with [flake8-type-ignore](https://gitlab.com/jonafato/flake8-type-ignore).

---

See also https://github.com/ComPWA/ampform/pull/168 and https://github.com/ComPWA/tensorwaves/pull/332

</details>


📝 Documentation

<details>
<summary>Added Zenodo DOI badge (106)</summary>

Closes https://github.com/ComPWA/compwa-org/issues/55

[![Zenodo DOI](https://zenodo.org/badge/doi/10.5281/zenodo.5526360.svg)](https://doi.org/10.5281/zenodo.5526360)

</details>

<details>
<summary>QRules can now be installed from Conda-Forge (115)</summary>

Closes 59

</details>


🖱️ Developer Experience

<details>
<summary>Fixed .flake8 config syntax (116)</summary>

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`.

</details>


<details>
<summary>Embedded Zenodo metadata (112)</summary>

Closes https://github.com/ComPWA/compwa-org/issues/64

</details>

0.9.2

_Release for first Zenodo DOI_
[![Zenodo DOI](https://zenodo.org/badge/doi/10.5281/zenodo.5526360.svg)](https://doi.org/10.5281/zenodo.5526360)

See all documentation for this version [here](https://qrules.rtfd.io/en/0.9.2).

💡 New features

<details>
<summary>Added more pretty reprs through decorator (85)</summary>

Following classes are now better represented in Jupyter noteboooks:

- `InitialFacts`
- `InteractionProperties`
- `EdgeSettings`
- `NodeSettings`
- `GraphSettings`
- `GraphElementProperties`
- `QNProblemSet`
- `QuantumNumberSolution`
- `QNResult`
- `ExecutionInfo`

</details>

<details>
<summary>ProblemSet can now be rendered as DOT (86)</summary>

Closes 28

</details>

<details>
<summary>Allow setting custom topologies in STM (103)</summary>

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.

</details>

🐛 Bug fixes

<details>
<summary>Use functools.wraps in decorators (b988057)</summary>

Improves the docstrings of decorated functions.

</details>

📝 Documentation

<details>
<summary>Removed references to the expert system in the documentation (104)</summary>

Links in the documentation were sometimes still pointing to the `expertsystem` website. Best avoided by keeping `intersphinx_mapping` as small as possible.

</details>

<details>
<summary>Added conservation rules page (84)</summary>

Describe how to use the [`conservation_rules`](https://qrules.readthedocs.io/en/0.9.1/api/qrules.conservation_rules.html) 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).

</details>

<details>
<summary>Decreased code line width in notebooks (88)</summary>

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.

</details>

<details>
<summary>Page content on the documentation is now wider (98)</summary>

See ComPWA/ampform104

</details>

<details>
<summary>Embedded GPLv3+ license file (100)</summary>

Some platforms like Zenodo and conda-forge require the license file to be packaged.

</details>

<details>
<summary>Extended package description in README and removed tick-boxed (101)</summary>

Removed the tick-boxes there, because they do not render correctly on PyPI.

</details>

<details>
<summary>Added package description for PyPI (102)</summary>

Closes https://github.com/ComPWA/compwa-org/issues/61

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

</details>

<details>
<summary>Removed references to the expert system in the documentation (104)</summary>

Links in the documentation were sometimes still pointing to the `expertsystem` website. Best avoided by keeping `intersphinx_mapping` as small as possible.

</details>

<details>
<summary>Added a notebook that shows how to feed custom topologies to the StateTransitionManager (103)</summary>

Closes 96

An example for 2-to-2 topologies (see also 29) is illustrated in a new notebook.

</details>

<details>
<summary>Switched to compwa-org web-page for contributing (93)</summary>

</details>

🖱️ Developer Experience

<details>
<summary>Switched to pre-commit.ci where possible (87)</summary>

[pre-commit.ci](https://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'](https://pre-commit.com/#repository-local-hooks). 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](https://pre-commit.ci/#configuration) (at most set to `quarterly`). It is (for now) better to upgrade the hooks along with the requirement pinning though.

</details>

🔨 Internal maintenance

<details>
<summary>Removed mdit-py-plugins version limit (94)</summary>

See https://github.com/ComPWA/ampform/pull/147

</details>

0.9.1

See all documentation for this version [here](https://qrules.rtfd.io/en/0.9.1).

⚠️ Interface

<details>
<summary>StateTransitionCollection ordered has become ordered (77)</summary>

Turn `StateTransitionCollection` into an immutable `abc.Sequence`, instead of a `set`.

</details>


🐛 Bug fixes

<details>
<summary>Allow rendering iterables with graphviz (78)</summary>

Allow converting an **iterable** (not just a sequence) to DOT. This enables rendering for instance the output of a `filter` as DOT:

python
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)


![image](https://user-images.githubusercontent.com/29308176/123068857-91781d00-d412-11eb-8937-9c136cecd1da.png)


</details>

<details>
<summary>Node properties for StateTransition are now also rendered (80)</summary>



</details>

0.9.0

**‼ Contains major changes to `qrules.generate_transitions`**

See all documentation for this version [here](https://qrules.rtfd.io/en/0.8.3).

💡 New features

<details>
<summary>Particles can now be sorted (72)</summary>

This PR allows sorting `Particle` instances. This is useful later on in 26, when `StateTransition`s are meant to become frozen and sortable.

Note that `ParticleCollection.names` now returns a **`list`**, sorted using the [`total_ordering`](https://docs.python.org/3.9/library/functools.html#functools.total_ordering) of `Particle`.

</details>


⚠️ Interface

<details>
<summary>Rename formalism_type to formalism (69)</summary>

Use
python
result = qrules.generate_transitions(
....
formalism="canonical-helicity",
)

instead of

python
result = qrules.generate_transitions(
....
formalism_type="canonical-helicity",
)


</details>

<details>
<summary>Use canonical-helicity by default (70)</summary>

Canonical is the most complete set of solutions. The idea is to do the formalism filtering later on, in AmpForm (see 12).

</details>

<details>
<summary>Return sorted list for ParticleCollection.names (72)</summary>

`ParticleCollection.names` now returns a **`list`**, sorted using the [`total_ordering`](https://docs.python.org/3.9/library/functools.html#functools.total_ordering) of `Particle`.

</details>

<details>
<summary>allowed_interaction_types has become more strict in what types of descriptions it takes (74)</summary>

Simplifies the slightly confusing rules for the `allowed_interaction_types` argument of `qrules.generate_transitions`.

</details>

<details>
<summary>The Result class has been replaced with a frozen ReactionInfo class (75)</summary>

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:
- `Topology` and `Topology` now have a pretty printer methods (as have `StateTransition` etc.)
- `FrozenDict` has gotten ordering (for sorting `StateTransition`s and `Topology`s).

</details>

📝 Documentation

<details>
<summary>Documentation now uses import qrules without "as q" (66)</summary>

Use `import qrules` instead of `import qrules as q`, as it's not really needed to abbreviate this module.

</details>


🔨 Internal maintenance

<details>
<summary>Result fixture in the conftest.py for the unit tests has been parametrized (67)</summary>

See https://docs.pytest.org/en/6.2.x/parametrize.html

</details>

<details>
<summary>repr methods in tests are parametrized (68)</summary>

Also includes [`pytest-flake8`](https://pypi.org/project/pytest-flake8) fixes

</details>

<details>
<summary>Fixed more problems identified by pytest-flake8 (68)</summary>

See [`pytest-flake8`](https://pypi.org/project/pytest-flake8)

</details>

0.8.2

See all documentation for this version [here](https://qrules.rtfd.io/en/0.8.2).

📝 Documentation

<details>
<summary>Improved docstrings about interaction properties (57)</summary>

It's not well documented what the labels of an interaction node mean (see for instance [this graph visualization](https://qrules.readthedocs.io/en/0.8.1/usage.html#investigate-intermediate-resonances)).

Rendering of special methods in the API has also been improved.

</details>

🐛 Bug fixes

<details>
<summary>Refuse rendering collapsed graphs with node properties (57)</summary>

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`.

</details>

🖱️ Developer Experience

<details>
<summary>Milestone are now automatically closed upon release (62)</summary>

</details>

0.8.1

_Maintenance release: mainly improves mobile version of the website._

See all documentation for this version [here](https://qrules.rtfd.io/en/0.8.1).

⚠️ Interface

<details>
<summary>Optional dependencies "extras" has been renamed to "all" (a2fc2dd)</summary>

</details>

🖱️ Developer Experience

<details>
<summary>Added PR template + gitpod extensions (52)</summary>

</details>

<details>
<summary>GitPod now automatically installs recommended VSCode extensions (52)</summary>

</details>

<details>
<summary>Notebooks can now be run through pytest (53)</summary>

Provides a faster way of running all notebooks. Usage:

shell
tox -e testnb
EXECUTE_NB=yes tox -e testnb as if run by Sphinx

or
shell
poytest --nb-test-files all tests and notebooks
pytest docs --nb-test-files
pytest docs --nb-test-files -n auto parallel


Rest of the configuration, such as ignoring cell output, is provided through `pytest.ini`. For further info, see [`pytest-notebook`](https://pytest-notebook.readthedocs.io/en/stable).

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.

</details>

<details>
<summary>Removed nbstripout from developer dependencies (c7c93f7)</summary>

Only available as `pre-commit` hook now.

</details>

<details>
<summary>Added more flake8 plugins and fixed identified problems (ffa91f5)</summary>

- [`flake8-use-fstring`](http://pypi.org/project/flake8-use-fstring)
- [`flake8-pytest-style`](http://pypi.org/project/flake8-pytest-style)
- [`flake8-comprehensions`](http://pypi.org/project/flake8-comprehensions)

</details>

<details>
<summary>Added VSCode test explorer extension (2318823)</summary>

Native VSCode test explorer doesn't work as great. For instance, it's not possible to run all tests within a folder.

</details>

Page 3 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.