Skip to content

Commit

Permalink
Merge pull request #172 from smash-transport/sparkx_devel
Browse files Browse the repository at this point in the history
Push to version 1.1.0-Newton
  • Loading branch information
Hendrik1704 authored Dec 7, 2023
2 parents 7b3cc15 + 8d7abdf commit 598c28a
Show file tree
Hide file tree
Showing 43 changed files with 5,117 additions and 1,503 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/GitHub_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Tests

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
- sparkx_devel

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run tests
run: |
python -m pytest tests/

- name: Check test results
run: |
if [ $? -ne 0 ]; then
echo "Tests failed. Blocking pull request merge."
exit 1
fi
32 changes: 32 additions & 0 deletions .github/workflows/PyPI_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to PyPI

on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine

- name: Build and publish
run: |
python setup.py sdist bdist_wheel
python -m twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Deploy Documentation

on:
push:
tags:
- 'v**' # specify the pattern for release tags
branches:
- main

permissions:
contents: write
Expand All @@ -23,14 +23,14 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9" # adjust the Python version if needed
python-version: "3.9"
cache: "pip"
architecture: "x64"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # adjust the path if needed
pip install -r requirements.txt

- name: Build documentation
run: |
Expand All @@ -41,4 +41,4 @@ jobs:
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: docs/build/html # adjust the path if needed
publish_dir: docs/build/html
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
docs/build/
96 changes: 96 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Changelog

All notable changes to this project will be documented in this file.

The versioning of the codebase is inspired by [Semantic Versioning](https://semver.org/spec/v2.0.0.html) with a version number `X.Y.Z`, where

* `X` is incremented for major changes (e.g. large backwards incompatible updates),
* `Y` is incremented for minor changes (e.g. external pull-request that adds one feature) and
* `Z` is incremented for the indication of a bug fix or other very small changes that are not backwards incompatible.

The main categories for changes in this file are:

* `Input / Output` for all, in particular breaking, changes, fixes and additions to the in- and output files;
* `Added` for new features;
* `Changed` for changes in existing functionality;
* `Fixed` for any bug fixes;
* `Removed` for now removed features.

A `Deprecated` section could be added if needed for soon-to-be removed features.

## v1.1.0-Newton

### Added

* Import with `from sparkx import *` is now possible
* EventCharacteristics: Possibility to smear (Gaussian or covariant) energy, baryon, charge and strangeness densities in Milne and Minkowski coordinates with writing to a file for subsequent hydro evolution
* Histogram: Method to set the systematic error
* Lattice3D: Add covariant smearing of densities for particles
* Oscar: Add option to apply filters while read-in to improve RAM usage
* Oscar: Add spacetime cut
* Particle: Add strangeness, spin and spin_degeneracy functions
* Tests: Add automatic tests for the Particle class
* GenerateFlow: Add functionality to generate flow with k-particle correlations
* LeeYangZeroFlow: Add beta version of integrated and differential flow analysis with the Lee-Yang zero method
* QCumulantFlow: Add beta version of integrated flow analysis with the Q-Cumulant method
* PCAFlow: Add flow analysis with PCA method
* CentralityClasses: Class to determine the centrality classes from a set of events

### Fixed

* Histogram: Correct error handling when reweighting or averaging over histograms
* Oscar/Jetscape: Fix bug when reading in a single event from input file
* Jetscape: Fix asymmetric pseudorapidity cut

### Changed

* Histogram: Can write multiple histograms to file now
* Oscar/Jetscape: Handling of PDG id's which are not present in the `particle` package is moved to the Particle class
* Oscar/Jetscape: Improved writing to file
* Particle: Particle construction is now done within the constructor by providing a format and an array of values
* Particle: Internal structure is now a numpy float array
* Particle: Functions using `PDGID` from the `particle` package handle now the case if the PDG ID is unknown to the package
* Particle: Returns `nan` if the quantity is not known or can not be computed

# Removed


## v1.0.2-Newton
Date: 2023-06-26

### Fixed

* Bug fix in Histogram class for values outside the bin range

### Changed

* Histogram printout to the terminal

[Link to diff from previous version](https://github.com/smash-transport/sparkx/compare/v1.0.1...v1.0.2)

## v1.0.1-Newton
Date: 2023-06-19

### Added

* Read in of X-SCAPE hadron output

### Fixed

* JetAnalysis class can be imported now
* Jet analysis can be performed with different jet finding algorithms without throwing errors

[Link to diff from previous version](https://github.com/smash-transport/sparkx/compare/v1.0.0...v1.0.1)

## v1.0.0-Newton
Date: 2023-06-14

**[First public version of SPARKX](https://github.com/smash-transport/sparkx/releases/tag/v1.0.0)**

### Added

* SMASH / Jetscape particle data read in and processing
* Anisotropic flow analysis (reaction plane, event plane, scalar product methods)
* Jet analysis (wrapper for fastjet)
* Initial state characterization via eccentricities
* Histogram class
14 changes: 9 additions & 5 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Credits
=======

Contributors
------------
- Hendrik Roch <[email protected]>
- Nils Sass <[email protected]>
- Niklas Götz <[email protected]>
The SPARKX Team
---------------

Author | &ensp;E-Mail&ensp; | Copyright ©
:----: | :----: | :---------: |
Niklas Götz | [✉️](mailto:[email protected]) | `2023 -` |
Hendrik Roch | [✉️](mailto:[email protected]) | `2023 -` |
Nils Sass | [✉️](mailto:[email protected]) | `2023 -` |

File renamed without changes.
10 changes: 10 additions & 0 deletions docs/source/classes/CentralityClasses/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _centrality_classes:

CentralityClasses
=================

.. currentmodule:: CentralityClasses
.. autoclass:: CentralityClasses

.. automethod:: CentralityClasses.get_centrality_class
.. automethod:: CentralityClasses.output_centrality_classes
4 changes: 3 additions & 1 deletion docs/source/classes/EventCharacteristics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ EventCharacteristics
.. autoclass:: EventCharacteristics

.. automethod:: EventCharacteristics.set_event_data
.. automethod:: EventCharacteristics.eccentricity
.. automethod:: EventCharacteristics.eccentricity
.. automethod:: EventCharacteristics.generate_eBQS_densities_Milne_from_OSCAR_IC
.. automethod:: EventCharacteristics.generate_eBQS_densities_Minkowski_from_OSCAR_IC
1 change: 1 addition & 0 deletions docs/source/classes/Histogram/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Histogram
.. automethod:: Histogram.average_weighted
.. automethod:: Histogram.standard_error
.. automethod:: Histogram.statistical_error
.. automethod:: Histogram.set_systematic_error
.. automethod:: Histogram.scale_histogram
.. automethod:: Histogram.set_error
.. automethod:: Histogram.print_histogram
Expand Down
1 change: 1 addition & 0 deletions docs/source/classes/Jetscape/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ Jetscape
.. automethod:: Jetscape.rapidity_cut
.. automethod:: Jetscape.pseudorapidity_cut
.. automethod:: Jetscape.multiplicity_cut
.. automethod:: Jetscape.particle_status
.. automethod:: Jetscape.print_particle_lists_to_file
3 changes: 3 additions & 0 deletions docs/source/classes/Lattice3D/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Lattice3D
.. automethod:: Lattice3D.set_value_by_index
.. automethod:: Lattice3D.get_value_by_index
.. automethod:: Lattice3D.set_value
.. automethod:: Lattice3D.set_value_nearest_neighbor
.. automethod:: Lattice3D.get_value
.. automethod:: Lattice3D.get_value_nearest_neighbor
.. automethod:: Lattice3D.get_coordinates
.. automethod:: Lattice3D.find_closest_indices
.. automethod:: Lattice3D.interpolate_value
Expand All @@ -23,4 +25,5 @@ Lattice3D
.. automethod:: Lattice3D.interpolate_to_lattice
.. automethod:: Lattice3D.interpolate_to_lattice_new_extent
.. automethod:: Lattice3D.reset
.. automethod:: Lattice3D.add_same_spaced_grid
.. automethod:: Lattice3D.add_particle_data
5 changes: 2 additions & 3 deletions docs/source/classes/Particle/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Particle
.. autoclass:: Particle

.. automethod:: Particle.print_particle
.. automethod:: Particle.set_quantities_OSCAR2013
.. automethod:: Particle.set_quantities_OSCAR2013Extended
.. automethod:: Particle.set_quantities_JETSCAPE
.. automethod:: Particle.angular_momentum
.. automethod:: Particle.momentum_rapidity_Y
.. automethod:: Particle.p_abs
Expand All @@ -26,3 +23,5 @@ Particle
.. automethod:: Particle.is_hadron
.. automethod:: Particle.is_strange
.. automethod:: Particle.is_heavy_flavor
.. automethod:: Particle.spin
.. automethod:: Particle.spin_degeneracy
2 changes: 1 addition & 1 deletion docs/source/classes/flow/EventPlaneFlow/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _event_plane_flow:

EventPlaneFlow
=================
==============

.. currentmodule:: EventPlaneFlow
.. autoclass:: EventPlaneFlow
Expand Down
4 changes: 4 additions & 0 deletions docs/source/classes/flow/GenerateFlow/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ GenerateFlow

.. automethod:: GenerateFlow.generate_dummy_JETSCAPE_file
.. automethod:: GenerateFlow.generate_dummy_JETSCAPE_file_realistic_pt_shape
.. automethod:: GenerateFlow.generate_dummy_JETSCAPE_file_multi_particle_correlations
.. automethod:: GenerateFlow.generate_dummy_JETSCAPE_file_realistic_pt_shape_multi_particle_correlations
.. automethod:: GenerateFlow.generate_dummy_OSCAR_file
.. automethod:: GenerateFlow.generate_dummy_OSCAR_file_realistic_pt_shape
.. automethod:: GenerateFlow.generate_dummy_OSCAR_file_multi_particle_correlations
.. automethod:: GenerateFlow.generate_dummy_OSCAR_file_realistic_pt_shape_multi_particle_correlations
10 changes: 10 additions & 0 deletions docs/source/classes/flow/LeeYangZeroFlow/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _Lee_Yang_zero_flow:

LeeYangZeroFlow
===============

.. currentmodule:: LeeYangZeroFlow
.. autoclass:: LeeYangZeroFlow

.. automethod:: LeeYangZeroFlow.integrated_flow
.. automethod:: LeeYangZeroFlow.differential_flow
10 changes: 10 additions & 0 deletions docs/source/classes/flow/PCAFlow/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _PCA_flow:

PCAFlow
=======

.. currentmodule:: PCAFlow
.. autoclass:: PCAFlow

.. automethod:: PCAFlow.differential_flow
.. automethod:: PCAFlow.Pearson_correlation
10 changes: 10 additions & 0 deletions docs/source/classes/flow/QCumulantFlow/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _QCumulant_flow:

QCumulantFlow
=============

.. currentmodule:: QCumulantFlow
.. autoclass:: QCumulantFlow

.. automethod:: QCumulantFlow.integrated_flow
.. automethod:: QCumulantFlow.differential_flow
5 changes: 4 additions & 1 deletion docs/source/classes/flow/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Flow
.. toctree::
:maxdepth: 2

ReactionPlaneFlow/index
ScalarProductFlow/index
EventPlaneFlow/index
ReactionPlaneFlow/index
LeeYangZeroFlow/index
QCumulantFlow/index
PCAFlow/index
GenerateFlow/index

1 change: 1 addition & 0 deletions docs/source/classes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Classes
flow/index
Lattice3D/index
EventCharacteristics/index
CentralityClasses/index
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
'sphinx.ext.coverage',
'numpydoc',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'myst_parser', # for markdown parsing (needs myst-parser package)
'sphinx_rtd_theme'
]
Expand Down
3 changes: 1 addition & 2 deletions docs/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
particle
numpy
scipy
matplotlib
sphinx
fastjet
sphinx
numpydoc
myst-parser
sphinx-rtd-theme
Expand Down
Loading

0 comments on commit 598c28a

Please sign in to comment.