Qrules

Latest version: v0.10.3

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

Scan your dependencies

Page 3 of 3

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>

0.8.0

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

💡 New features

<details>
<summary>Determine quantum number domains from a ParticleCollection (45)</summary>

From https://github.com/ComPWA/expertsystem/pull/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.

</details>

<details>
<summary>Extend configuration arguments in facade functions (40) by wgradl</summary>

Allow setting the maximum angular momentum and spin magnitude through `check_reaction_violations()` and `generate_transitions()`.

</details>


⚠️ Interface

<details>
<summary>Rename default_settings to settings (43)</summary>

</details>

<details>
<summary>Rename to InteractionTypes to InteractionType (47)</summary>

Policy is that enums should be singular, so that the syntax makes more sense, especially in docstrings. For instance:
- "Which `InteractionType`?"
- "Use `InteractionType.WEAK` instead of..."

Same with the (already existing) `SolvingMode`.

</details>

<details>
<summary>Rename particles argument to particle_db in several functions (50)</summary>

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.

</details>


🐛 Bug fixes

<details>
<summary>Fix link to codacy badge (4)</summary>

</details>

<details>
<summary>Define testpaths in pytest.ini (42)</summary>

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 :tada:

</details>


🔨 Internal maintenance

<details>
<summary>Added a test to verify default interaction settings (41)</summary>

Taken from https://github.com/ComPWA/expertsystem/pull/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 https://github.com/ComPWA/expertsystem/pull/486#issuecomment-775040377)

</details>


📝 Documentation

<details>
<summary>Several improvements to the documentation</summary>

See 3, 35ebed2, 8d4e940, 44, and 8deee77

</details>


🖱️ Developer Experience

<details>
<summary>Split GitHub Actions workflow "CI" into CI-style, CI-docs, and CI-tests (36)</summary>

</details>

<details>
<summary>Let Read the Docs fail if there are warning (37)</summary>

</details>

<details>
<summary>Define all requirements setup.cfg and pin versions through constraint files (39)</summary>

With the release of [`pip-tools` v6.1.0](https://github.com/jazzband/pip-tools/releases/tag/6.1.0), `pip-compile` now correctly handles [`extras_require`](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies). This allows for a big clean-up of the set-up introduced by https://github.com/ComPWA/expertsystem/pull/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](https://github.com/ComPWA/qrules/runs/2346236017?check_suite_focus=true) versus almost [3min](https://github.com/ComPWA/qrules/runs/2322145112?check_suite_focus=true)
- 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

</details>

<details>
<summary>Define testpaths in pytest.ini (42)</summary>

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 :tada:

</details>

0.8.0a1

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

⚠️ Interface

* Extract `expertsystem.reaction` as `qrules` package (1 and 2)
The `expertsystem` has been split up into `qrules` and `ampform` :tada:

Page 3 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.