Skip to content

Commit

Permalink
refactor!: rename package to qrules (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Apr 6, 2021
1 parent 27ba25f commit d17604d
Show file tree
Hide file tree
Showing 117 changed files with 317 additions and 4,652 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name-template: PWA Expert System $NEXT_PATCH_VERSION
name-template: QRules $NEXT_PATCH_VERSION
tag-template: $NEXT_PATCH_VERSION

categories:
Expand Down Expand Up @@ -32,6 +32,6 @@ sort-direction: ascending
template: |
# Release $NEXT_PATCH_VERSION
See all documentation for this version [here](https://expertsystem.rtfd.io/en/$NEXT_PATCH_VERSION).
See all documentation for this version [here](https://qrules.rtfd.io/en/$NEXT_PATCH_VERSION).
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip install -r reqs/${{ matrix.python-version }}/requirements-test.txt
pip install .
- name: Test with pytest-cov
run: pytest -n auto --cov=expertsystem --cov-report=xml
run: pytest -n auto --cov=qrules --cov-report=xml
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
Expand Down
6 changes: 2 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"json.schemas": [
{
"fileMatch": ["*particle*.json"],
"url": "./src/expertsystem/reaction/particle-validation.json"
"url": "./src/qrules/particle-validation.json"
}
],
"python.analysis.autoImportCompletions": false,
Expand Down Expand Up @@ -75,9 +75,7 @@
"telemetry.enableCrashReporter": false,
"telemetry.enableTelemetry": false,
"yaml.schemas": {
"./src/expertsystem/reaction/particle-validation.json": [
"*particle*.y*ml"
],
"./src/qrules/particle-validation.json": ["*particle*.y*ml"],
"https://raw.githubusercontent.com/readthedocs/readthedocs.org/master/readthedocs/rtd_tests/fixtures/spec/v2/schema.yml": ".readthedocs.yml"
}
}
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# PWA Expert System
# Quantum Conservation Rules (`qrules`)

[![Documentation build status](https://readthedocs.org/projects/expertsystem/badge/?version=latest)](https://expertsystem.readthedocs.io)
[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ComPWA/expertsystem/stable?filepath=docs/usage)
[![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ComPWA/expertsystem/blob/stable)
[![Documentation build status](https://readthedocs.org/projects/qrules/badge/?version=latest)](https://qrules.readthedocs.io)
[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ComPWA/qrules/stable?filepath=docs/usage)
[![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ComPWA/qrules/blob/stable)
[![GPLv3+ license](https://img.shields.io/badge/License-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0-standalone.html)
[![GitPod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/expertsystem)
[![GitPod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/qrules)
<br>
[![PyPI package](https://badge.fury.io/py/expertsystem.svg)](https://pypi.org/project/expertsystem)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/expertsystem)](https://pypi.org/project/expertsystem)
[![PyPI package](https://badge.fury.io/py/qrules.svg)](https://pypi.org/project/qrules)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/qrules)](https://pypi.org/project/qrules)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy.readthedocs.io)
[![CI status](https://github.com/ComPWA/expertsystem/workflows/CI/badge.svg)](https://github.com/ComPWA/expertsystem/actions?query=branch%3Amain+workflow%3ACI)
[![Test coverage](https://codecov.io/gh/ComPWA/expertsystem/branch/main/graph/badge.svg)](https://codecov.io/gh/ComPWA/expertsystem)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/db355758fb0e4654818b85997f03e3b8)](https://www.codacy.com/gh/ComPWA/expertsystem)
[![CI status](https://github.com/ComPWA/qrules/workflows/CI/badge.svg)](https://github.com/ComPWA/qrules/actions?query=branch%3Amain+workflow%3ACI)
[![Test coverage](https://codecov.io/gh/ComPWA/qrules/branch/main/graph/badge.svg)](https://codecov.io/gh/ComPWA/qrules)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/db355758fb0e4654818b85997f03e3b8)](https://www.codacy.com/gh/ComPWA/qrules)
<br>
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen)](https://github.com/pre-commit/pre-commit)
[![Prettier](https://camo.githubusercontent.com/687a8ae8d15f9409617d2cc5a30292a884f6813a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d70726574746965722d6666363962342e7376673f7374796c653d666c61742d737175617265)](https://prettier.io/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort)

Visit [expertsystem.rtfd.io](https://pwa.readthedocs.io/projects/expertsystem)
for an introduction to the Particle Wave Analysis Expert System!
Visit [qrules.rtfd.io](https://qrules.readthedocs.io) for more information!

For an overview of **upcoming releases and planned functionality**, see
[here](https://github.com/ComPWA/expertsystem/milestones?direction=asc&sort=title&state=open).
[here](https://github.com/ComPWA/qrules/milestones?direction=asc&sort=title&state=open).

QRules originates from the
[`expertsystem`](https://pypi.org/project/expertsystem)

## Available features

Expand All @@ -45,14 +47,6 @@ For an overview of **upcoming releases and planned functionality**, see
- [x] Mass conservation
- [x] Predefined sets of conservation rules representing Strong, EM, Weak
interactions
- **PWA formalisms (for amplitude model generation)**
- [x] Helicity formalism
- [x] Canonical formalism
- [ ] Tensor formalisms
- **Amplitude model**: Convert the state transition graphs to an amplitude
model that is _mathematically expressed_ with [SymPy](https://docs.sympy.org)
and can be _converted to any backend_ (see
[`tensorwaves`](http://tensorwaves.rtfd.io)).

## Contribute

Expand Down
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"determinator",
"determinators",
"docstrings",
"expertsystem",
"fermionic",
"flatté",
"functors",
Expand Down Expand Up @@ -93,6 +92,7 @@
"pylint",
"pyplot",
"pytest",
"qrules",
"redeboer",
"setuptools",
"spflueger",
Expand All @@ -107,6 +107,7 @@
],
"ignoreWords": [
"adrs",
"ampform",
"arange",
"asdict",
"asdot",
Expand All @@ -127,6 +128,7 @@
"epem",
"eval",
"evalf",
"expertsystem",
"figsize",
"flatte",
"fromdict",
Expand Down
2 changes: 1 addition & 1 deletion docs/adr.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Architectural Decision Records

This log lists the architectural decisions for the
[ExpertSystem repository](https://github.com/ComPWA/expertsystem):
[QRules repository](https://github.com/ComPWA/qrules):

```{toctree}
---
Expand Down
12 changes: 6 additions & 6 deletions docs/adr/001/operators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@
}
],
"source": [
"import expertsystem as es\n",
"import qrules as q\n",
"\n",
"result = es.generate_transitions(\n",
"result = q.generate_transitions(\n",
" initial_state=[(\"J/psi(1S)\", [-1, 1])],\n",
" final_state=[\"p\", \"p~\", \"eta\"],\n",
" allowed_intermediate_particles=[\"N(1440)\"],\n",
" allowed_interaction_types=\"strong\",\n",
")\n",
"model = es.generate_amplitudes(result)\n",
"model = q.generate_amplitudes(result)\n",
"for particle in result.get_intermediate_particles():\n",
" model.dynamics.set_breit_wigner(particle.name)\n",
"es.io.write(model, \"recipe.yml\")"
"q.io.write(model, \"recipe.yml\")"
]
},
{
Expand Down Expand Up @@ -235,7 +235,7 @@
"import graphviz\n",
"\n",
"graphs = result.collapse_graphs()\n",
"dot = es.io.asdot(graphs)\n",
"dot = q.io.asdot(graphs)\n",
"graphviz.Source(dot)"
]
},
Expand Down Expand Up @@ -430,7 +430,7 @@
" Node,\n",
" ParticleDynamics,\n",
")\n",
"from expertsystem.reaction.particle import Particle\n",
"from qrules.particle import Particle\n",
"\n",
"\n",
"@attr.s\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/adr/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Summary of problems with the existing design, possibly with some snippets.
If available, list and link related issues, PRs, or ADRs that led up to this
ADR:
- [#000](https://github.com/ComPWA/expertsystem/issues/000)
- [#000](https://github.com/ComPWA/expertsystem/issues/000)
- [#000](https://github.com/ComPWA/qrules/issues/000)
- [#000](https://github.com/ComPWA/qrules/issues/000)
-->

## Decision drivers
Expand Down
19 changes: 12 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from pkg_resources import get_distribution

# -- Project information -----------------------------------------------------
project = "ExpertSystem"
package = "expertsystem"
repo_name = "expertsystem"
project = "QRules"
package = "qrules"
repo_name = "qrules"
copyright = "2020, ComPWA"
author = "Common Partial Wave Analysis"

Expand Down Expand Up @@ -145,7 +145,7 @@
},
"theme_dev_mode": True,
}
html_title = "PWA Expert System"
html_title = "QRules"
pygments_style = "sphinx"
todo_include_todos = False
viewcode_follow_imported_members = True
Expand All @@ -166,13 +166,18 @@
("py:class", "numpy.typing._dtype_like._DTypeDict"),
("py:class", "numpy.typing._dtype_like._SupportsDType"),
("py:class", "typing_extensions.Protocol"),
("py:obj", "expertsystem.amplitude.helicity.ValueType"),
("py:obj", "expertsystem.reaction.topology._K"),
("py:obj", "expertsystem.reaction.topology._V"),
("py:mod", "ampform"),
("py:obj", "qrules.topology._K"),
("py:obj", "qrules.topology._V"),
]

# Intersphinx settings
intersphinx_mapping = {
"ampform": ("https://ampform.readthedocs.io/en/stable", None),
"expertsystem": (
"https://pwa.readthedocs.io/projects/expertsystem/en/stable",
None,
),
"attrs": ("https://www.attrs.org/en/stable", None),
"constraint": (
"https://labix.org/doc/constraint/public",
Expand Down
47 changes: 23 additions & 24 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
# Welcome to the PWA Expert System!
# Welcome to QRules!

```{title} Welcome
```

[![PyPI package](https://badge.fury.io/py/expertsystem.svg)](https://pypi.org/project/expertsystem)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/expertsystem)](https://pypi.org/project/expertsystem)
[![Test coverage](https://codecov.io/gh/ComPWA/expertsystem/branch/main/graph/badge.svg)](https://codecov.io/gh/ComPWA/expertsystem)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/db355758fb0e4654818b85997f03e3b8)](https://www.codacy.com/gh/ComPWA/expertsystem)
[![PyPI package](https://badge.fury.io/py/qrules.svg)](https://pypi.org/project/qrules)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/qrules)](https://pypi.org/project/qrules)
[![Test coverage](https://codecov.io/gh/ComPWA/qrules/branch/main/graph/badge.svg?token=PPRMC5E6SX)](https://codecov.io/gh/ComPWA/qrules)

<!-- [![Codacy Badge](https://codecov.io/gh/ComPWA/qrules/branch/main/graph/badge.svg?token=PPRMC5E6SX)](https://www.codacy.com/gh/ComPWA/qrules) -->

````{margin}
```{tip}
For an overview of upcoming releases and planned functionality, see
[here](https://github.com/ComPWA/expertsystem/milestones?direction=asc&sort=title&state=open).
[here](https://github.com/ComPWA/qrules/milestones?direction=asc&sort=title&state=open).
```
````

The two purposes of the Partial Wave Analysis Expert System are to:
QRules is a system for validating and generating particle reactions, using
quantum number conservation rules. The user only has to provide a basic
information of the particle reaction, such as an initial state and a final
state. Helper functions provide easy ways to configure the system, but the user
still has full control. QRules then constructs several hypotheses for what
happens during the transition from initial to final state.

:::{dropdown} Original project: PWA Expert System

1. validate a particle reaction, based on given information. <br> E.g.: Can a
$\pi^0$ decay into 1, 2, 3 $\gamma$ particles?
2. create partial wave analysis amplitude models, based on basic information of
a reaction, for instance, an amplitude model for
$J/\psi \rightarrow \gamma\pi^0\pi^0$ in the helicity or canonical
formalism.
The original project was the {doc}`expertsystem:index`. QRules originates from
its `~expertsystem.reaction` module.

The user only has to provide a basic information of the particle reaction, such
as an initial state and a final state. Helper functions provide easy ways to
configure the system, but the user still has full control. The expert system
then constructs several hypotheses for what happens during the transition from
initial to final state.
:::

## Internal design

Internally, the PWA Expert System consists of three major components.
Internally, QRules consists of three major components.

### 1. State Transition Graphs

Expand Down Expand Up @@ -66,7 +66,7 @@ The determination of the correct state properties in the graph is done by
solvers. New properties are set for intermediate edges and interaction nodes
and their validity is checked with the conservation rules.

## Workflow of the Expert System
## QRules workflow

1. Preparation

Expand All @@ -90,8 +90,6 @@ and their validity is checked with the conservation rules.
2.3. _Validate_ the complete graphs, so run all conservation law check that
were postponed from the first step.

3. Generate an amplitude model, e.g. helicity or canonical amplitude.

## Table of Contents

```{toctree}
Expand All @@ -101,8 +99,8 @@ maxdepth: 2
install
usage
references
API <api/expertsystem>
Changelog <https://github.com/ComPWA/expertsystem/releases>
API <api/qrules>
Changelog <https://github.com/ComPWA/qrules/releases>
Develop <https://pwa.readthedocs.io/develop.html>
```

Expand All @@ -122,6 +120,7 @@ ADRs <adr>
caption: Related projects
hidden:
---
AmpForm <http://ampform.readthedocs.io>
TensorWaves <http://tensorwaves.readthedocs.io>
PWA Pages <http://pwa.readthedocs.io>
```
19 changes: 9 additions & 10 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
The fastest way of installing this package is through PyPI:

```shell
python3 -m pip install expertsystem
python3 -m pip install qrules
```

This installs the
[latest, stable release](https://pypi.org/project/expertsystem) that you can
find on the [`stable`](https://github.com/ComPWA/expertsystem/tree/stable)
branch. The latest version on the
[`main`](https://github.com/ComPWA/expertsystem/tree/main) branch can be
installed as follows:
This installs the [latest, stable release](https://pypi.org/project/qrules)
that you can find on the
[`stable`](https://github.com/ComPWA/qrules/tree/stable) branch. The latest
version on the [`main`](https://github.com/ComPWA/qrules/tree/main) branch can
be installed as follows:

```shell
python3 -m pip install git+https://github.com/ComPWA/expertsystem@main
python3 -m pip install git+https://github.com/ComPWA/qrules@main
```

In that case, however, we highly recommend using the more dynamic,
Expand All @@ -24,8 +23,8 @@ This goes as follows:
1. Get the source code (see {doc}`pwa:software/git`):

```shell
git clone https://github.com/ComPWA/expertsystem.git
cd expertsystem
git clone https://github.com/ComPWA/qrules.git
cd qrules
```

2. **[Recommended]** Create a virtual environment (see
Expand Down
Loading

0 comments on commit d17604d

Please sign in to comment.