Qrules

Latest version: v0.10.3

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

Scan your dependencies

Page 2 of 3

0.9.7

_See all documentation for this version [here](https://qrules.rtfd.io/en/0.9.7)._

🐛 Bug fixes

<details>
<summary>ReactionInfo is now hashable (151)</summary>

This is particularly useful for [`functools.lru_cache()`](https://docs.python.org/3/library/functools.html#functools.lru_cache).

</details>

🔨 Internal maintenance

<details>
<summary>Switched to the new attrs API (152)</summary>

See [`import attrs`](https://hynek.me/articles/import-attrs/#the-last-step-import-attrs) and [`attrs` TNG](https://www.attrs.org/en/21.4.0/names.html#attrs-tng).

</details>

<details>
<summary>implement_pretty_repr() decorator is now implement_pretty_repr (154)</summary>

The `implement_pretty_repr()` decorator does not take any arguments, so one level can be removed. This changes it's usage from:

python
implement_pretty_repr() old
attrs.define
class SomeClass:
...


to

python
implement_pretty_repr <-- new
attrs.define
class SomeClass:
...


</details>

📝 Documentation

<details>
<summary>Type hints are abbreviated where possible (154)</summary>

Type hints are abbreviated with [`autodoc_typehints_format`](https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_typehints_format). But note that this does not yet work perfectly because of QRules' [custom reference relinking](https://github.com/ComPWA/qrules/commit/837923872c85e43b765ee7c5a3d6e415d8e330ad).

</details>

<details>
<summary>API is now sorted by position in the source code (154)</summary>

API is now sorted by position in the source code, **not alphabetically**.

</details>

<details>
<summary>Left sidebar is unfolded unto the second level (148)</summary>

Also unfolds the left sidebar unto the second level, like in https://github.com/ComPWA/ampform/pull/221 and https://github.com/ComPWA/tensorwaves/pull/407. Preview [here](https://qrules--148.org.readthedocs.build/en/148).

</details>

<details>
<summary>Added Hypothesis and utterances overlay to allow commenting on the documentation (149)</summary>

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

</details>

<details>
<summary>Explained how to pin dependencies with Conda (150)</summary>

Preview [here](https://qrules--150.org.readthedocs.build/en/150/install.html). See also https://github.com/ComPWA/tensorwaves/pull/411.

</details>

🖱️ Developer Experience

<details>
<summary>Upgrade cron job are now on even weeks only (148 and 153)</summary>

See https://github.com/ComPWA/repo-maintenance/pull/48

</details>

0.9.6

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

💡 New features

<details>
<summary>Topology is now ordered (137)</summary>

This can be used to create a unique, deterministic ordered list of `Topology` instances. See https://github.com/ComPWA/ampform/issues/6, where one needs a unique way of picking a reference topology.

</details>

<details>
<summary>Implemented Topology.relabel_edges() method (138)</summary>

See how to use this method to permutate final state IDs in a `Topology` case [here](https://qrules--138.org.readthedocs.build/en/138/api/qrules.topology.html#qrules.topology.Topology.relabel_edges).

</details>

<details>
<summary>qrules.io.asdot() function now accepts Graphviz attributes (139)</summary>

Accept Graphviz attributes in `qrules.io.asdot()`, so that the edges, nodes and overall DOT visualization of `StateTransition`s etc. can be styled. See [here](https://qrules--139.org.readthedocs.build/en/139/usage/visualize.html#styling) how to use.

</details>

<details>
<summary>Number of threads can now be set globally (140)</summary>

Closes 10 Closes 11

Added a new class [`NumberOfThreads`](https://qrules--140.org.readthedocs.build/en/140/api/qrules.settings.html#qrules.settings.NumberOfThreads) under the [`settings`](https://qrules--140.org.readthedocs.build/en/140/api/qrules.settings.html) 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.

</details>

🐛 Bug fixes

<details>
<summary>Final state IDs in all StateTransitions match the order of the final_state argument in generate_transitions() (145)</summary>

Closes 143

Compare [this visualization in v0.9.5](https://qrules.readthedocs.io/en/0.9.5/usage/ls-coupling.html#check-with-qrules) with [the one for this PR](https://qrules--145.org.readthedocs.build/en/145/usage/ls-coupling.html#check-with-qrules).

- 10379d2 adds a test [that fails](https://github.com/ComPWA/qrules/runs/4980455593) the check described in #143
- 2e91cb4 [fixes](https://github.com/ComPWA/qrules/runs/4980458314) that test

</details>

📝 Documentation

<details>
<summary>Notebook pages can now be opened in Deepnote (136)</summary>

Closes https://github.com/ComPWA/repo-maintenance/issues/43

[![image](https://user-images.githubusercontent.com/29308176/149676020-8281cbb4-8cae-4e1a-a171-b451809ea993.png)](https://qrules--136.org.readthedocs.build/en/136/usage.html)

</details>

<details>
<summary>Default graphviz background is now transparent (141)</summary>

Follow-up to 139. Consequence is that exported PNG and SVG files have no background. Preview [here](https://qrules--141.org.readthedocs.build/en/141/usage/visualize.html).

Get old behaviour with `qrules.io.asdot(..., bgcolor="white")`.

</details>

<details>
<summary>Code examples are automatically linked to reference documentation (147)</summary>

All code examples are now clickable with links to corresponding reference documentation (also external links APIs) with [`sphinx-codeautolink`](https://sphinx-codeautolink.readthedocs.io). Closes https://github.com/ComPWA/compwa-org/issues/106 [![image](https://user-images.githubusercontent.com/29308176/151718856-b65caad0-f0aa-4da3-b2d9-9a72c743f849.png)](https://qrules--147.org.readthedocs.build/en/147/usage/reaction.html#define-the-problem-set)

</details>

🖱️ Developer Experience

<details>
<summary>Changed upgrade cron job to bi-weekly (135)</summary>

</details>

<details>
<summary>Installed jupyterlab-myst for MyST editing (147)</summary>

Installed [`jupyterlab-myst`](https://github.com/executablebooks/jupyterlab-myst)

</details>

<details>
<summary>Updated black formatting style (147)</summary>

Updated to the first non-beta black release [22.1.0](https://github.com/psf/black/releases/tag/22.1.0). Most important style effect: [no space around power operator `**`](https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#line-breaks-binary-operators).

</details>

0.9.5

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

💡 New features

<details>
<summary>qrules.io.asdot() can now use with both render_node=True with strip_spin=True (126)</summary>

This PR makes it possible to render `StateTransition`s with their node properties (`render_node=True`) _and_ stripped spin projections. This is required for 124.

</details>

🔨 Internal maintenance

<details>
<summary>Importing qrules is now about 4x faster (130)</summary>

See also https://github.com/ComPWA/tensorwaves/pull/363

</details>

📝 Documentation

<details>
<summary>Links to Binder/Colab point to branch matching the version of the documentation (121)</summary>

* 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

</details>

<details>
<summary>LS-coupling is now illustrated in notebook (124)</summary>

See https://qrules.rtfd.io/en/0.9.5/usage/ls-coupling.html

</details>


🖱️ Developer Experience

<details>
<summary>Run all notebooks with pytest (129)</summary>

Run with `tox -e nb` or `pytest --nbmake *.ipynb`.

</details>

<details>
<summary>Upgrade to attrs new generation API (129)</summary>

See https://github.com/ComPWA/compwa-org/issues/90

This also allows upgrading to `attrs` v21.1, which has better support for pyright
https://www.attrs.org/en/stable/types.html#pyright

</details>

0.9.4

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

🐛 Bug fixes

<details>
<summary>Support typing-extensions v3.7 (119)</summary>

Causes downstream problems with TensorFlow:
https://github.com/ComPWA/tensorwaves/runs/3996801941?check_suite_focus=true#step:9:9

</details>

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>

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.