Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.2.0 #101

Merged
merged 82 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
26b1654
function to split columns and tests
fsoubelet Dec 7, 2022
83535e9
bpm noise addition and tests
fsoubelet Dec 8, 2022
1fae5c9
versionadded for misc utils
fsoubelet Dec 9, 2022
6a8b3df
add details and examples to the matching functions
fsoubelet Dec 14, 2022
58c2627
up version for next release
fsoubelet Dec 18, 2022
e854022
remove nones in examples matching
fsoubelet Dec 22, 2022
36e0340
problem with numpy 1.24 in some plotting functions, the fill_between …
fsoubelet Dec 22, 2022
c771db2
formatting
fsoubelet Dec 22, 2022
df86b1c
formatting
fsoubelet Dec 22, 2022
b3203e3
baselines and tests for new plotting utils
fsoubelet Dec 22, 2022
225b37e
some simplification of type hints, add confidence ellipse function
fsoubelet Dec 22, 2022
50f8ade
spec to simplify display of ArrayLike type hint in docs
fsoubelet Dec 22, 2022
bd4dfd0
typo correction
fsoubelet Dec 22, 2022
c58ce42
release notes page for 1.2.0
fsoubelet Dec 22, 2022
fb4decf
ignore acc-models-lhc for black
fsoubelet Dec 29, 2022
b2fe4da
madx argument is now positional only in all APIs involving it
fsoubelet Dec 29, 2022
8e366f7
add info to release notes
fsoubelet Dec 29, 2022
01caa68
adapt few tests to positional only api
fsoubelet Dec 29, 2022
22dcf3f
adapt fixtures
fsoubelet Dec 29, 2022
28b94ea
yield from
fsoubelet Dec 29, 2022
777cafd
no yield from
fsoubelet Dec 29, 2022
5d3ca5a
adapt some more apis
fsoubelet Dec 29, 2022
380adf0
fix typo
fsoubelet Jan 20, 2023
1e60413
fix typo again
fsoubelet Jan 20, 2023
32ea754
better links in doc
fsoubelet Jan 24, 2023
92331f1
ability to plot octupoles too, should be tested
fsoubelet Jan 24, 2023
eb4cb3e
new year issue with the fucking htcondor reading
fsoubelet Jan 24, 2023
780a250
options and better handling of legends
fsoubelet Jan 26, 2023
3634a6d
propagate options for octupoles
fsoubelet Jan 26, 2023
8d8cc26
take kwargs, but private function
fsoubelet Jan 26, 2023
b3fd436
only add legend if at least one element was plotted, give a default f…
fsoubelet Feb 3, 2023
8c9bb75
docstring fix in lhc run2 setup for opticsfile arg
fsoubelet Feb 9, 2023
594d525
get PTC universe parameters from kwargs
fsoubelet Feb 14, 2023
695bbdc
docstring concat
fsoubelet Feb 15, 2023
82c5695
get PTC universe parameters from kwargs
fsoubelet Feb 15, 2023
4416884
get PTC universe parameters from kwargs
fsoubelet Feb 15, 2023
9f648cb
linking
fsoubelet Feb 15, 2023
8e3089f
get PTC universe parameters from kwargs
fsoubelet Feb 15, 2023
a538444
add examples
fsoubelet Feb 15, 2023
bf135d4
update baselines
fsoubelet Feb 15, 2023
59006cd
give me results
fsoubelet Feb 15, 2023
ef2b994
well chill on the tolerance, I even updated the files...
fsoubelet Feb 15, 2023
d8ff4c9
ptc kwargs in changelog
fsoubelet Feb 15, 2023
3ca4167
new doc dep
fsoubelet Feb 15, 2023
8527da8
add 3.11 to the test matrix
fsoubelet Feb 15, 2023
10649da
specify 2022 branch as 2023 or main does not have files yet
fsoubelet Feb 15, 2023
e6cbda0
3.11 here too
fsoubelet Feb 15, 2023
cd57733
fix variable name
fsoubelet Feb 21, 2023
0e7f3e2
add info to release notes
fsoubelet Feb 21, 2023
7d04131
should be ok with numpy bugfixes, lets try
fsoubelet Feb 21, 2023
0d1f71c
can now take single values for ylimits in layout plot
fsoubelet Mar 1, 2023
8ad2daf
add to changelog
fsoubelet Mar 1, 2023
a7abc84
more info in the examples
fsoubelet Mar 1, 2023
58dd9f3
add test for new functionality, with single value in knl_lim
fsoubelet Mar 1, 2023
1dd56b3
apparently its not ok to use tuple[float, float]
fsoubelet Mar 1, 2023
2d810cf
also test with k3l_lim given
fsoubelet Mar 1, 2023
724149a
also test raising
fsoubelet Mar 1, 2023
0f0b7eb
more test coverage: raises and slicefactor
fsoubelet Mar 2, 2023
66a4b70
more edge case
fsoubelet Mar 2, 2023
cf18e67
some more edge cases
fsoubelet Mar 2, 2023
7564ba9
duplicate but still tested for now, merge later
fsoubelet Mar 2, 2023
c1d0f0c
reworked beam enveloppe plotting function
fsoubelet Mar 5, 2023
c8fdaa2
get rid of these
fsoubelet Mar 5, 2023
8043de7
uncomment this private function as I use it in tests
fsoubelet Mar 5, 2023
857b503
reworked tests for new plotting function, updated ref files
fsoubelet Mar 5, 2023
542fb22
adapt the gallery page
fsoubelet Mar 5, 2023
9a02e38
release notes
fsoubelet Mar 5, 2023
910ea77
well that was a typo, now fixed
fsoubelet Mar 5, 2023
8a5b700
for new example
fsoubelet Mar 7, 2023
3347683
new example page for quick LHC setups
fsoubelet Mar 7, 2023
506b361
additional info in doc on USE and errors when installing things in th…
fsoubelet Mar 10, 2023
44f80e0
shorten width of doc
fsoubelet Mar 10, 2023
b0b0343
args and shorten doc width
fsoubelet Mar 10, 2023
cc33fd6
shorten width of doc
fsoubelet Mar 10, 2023
71c01e2
real aperture plotting
fsoubelet Mar 10, 2023
8145b90
change value
fsoubelet Mar 10, 2023
b9161a9
add examples here
fsoubelet Mar 10, 2023
9530afc
add apertures on front plot
fsoubelet Mar 10, 2023
a996add
add to changelog
fsoubelet Mar 10, 2023
c288086
change name
fsoubelet Mar 10, 2023
f006926
tests for physical aperture plotting
fsoubelet Mar 10, 2023
d1d592a
up action version, get away from deprecation warning
fsoubelet Mar 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Continous Integration Workflows
# Continuous Integration Workflows

This package implements different workflows for CI.
They are organised as follows.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: python -m pip install ".[test]"

- name: Get acc-models-lhc
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1

- name: Run all tests
run: make alltests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10", 3.x] # crons should always run latest python hence 3.x
python-version: [3.8, 3.9, "3.10", "3.11", 3.x] # crons should always run latest python hence 3.x
# exclude:
# - os: windows-latest # scipy deps issues
# python-version: "3.10"
Expand All @@ -42,7 +42,7 @@ jobs:
run: python -m pip install ".[test]"

- name: Get acc-models-lhc
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1

- name: Run Tests
run: make alltests
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

# Upload artifacts if in PR so reviewers can have a quick look without building documentation from the branch locally
- name: Upload build artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: success() && github.event_name == 'pull_request' # only for pushes in PR
with:
name: site-build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
fail-fast: false

steps:
Expand All @@ -42,7 +42,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest]
python-version: [3.8, 3.9, "3.10"]
python-version: [3.8, 3.9, "3.10", "3.11"]
fail-fast: false

steps:
Expand All @@ -59,7 +59,7 @@ jobs:
run: python -m pip install ".[test]"

- name: Get acc-models-lhc
run: git clone https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1
run: git clone -b 2022 https://gitlab.cern.ch/acc-models/acc-models-lhc.git --depth 1

- name: Run Tests
run: make slowtests
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

import pyhdtoolkit

# This is to tell Sphinx how to print some specific type annotations
# See: https://stackoverflow.com/a/67483317
# See: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_type_aliases
autodoc_type_aliases = {"ArrayLike": "ArrayLike"}

# To use SVG outputs when scraping matplotlib figures for the sphinx-gallery
class matplotlib_svg_scraper(object):
Expand Down Expand Up @@ -144,6 +148,7 @@ def __call__(self, *args, **kwargs):
"sphinx_panels", # Create panels in a grid layout or as drop-downs
"matplotlib.sphinxext.plot_directive", # Include a Matplotlib plot in a Sphinx document
"sphinx-prompt", # prompt symbols will not be copy-pastable
"sphinx_codeautolink", # Automatically link example code to documentation source
]

# Config for autosectionlabel extension
Expand Down
12 changes: 10 additions & 2 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,30 @@ Release Notes

The full list of releases can be found in the GitHub repository's `releases page <https://github.com/fsoubelet/PyhDToolkit/releases>`_.

Version 1.2.0
-------------

.. toctree::
:maxdepth: 2

releases/v1.2.0

Version 1.1.1
-------------

.. toctree::
:maxdepth: 2

releases/v1.1.1

Version 1.1.0
-------------

.. toctree::
:maxdepth: 2

releases/v1.1.0

Version 1.0.0
-------------

Expand Down
2 changes: 1 addition & 1 deletion docs/releases/v1.1.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Bug Fixes
* A few values in the available plotting settings were changed.


See `v1.1.1 release notes on GitHub <https://github.com/fsoubelet/PyhDToolkit/releases/tag/1.1.1>`_ and the `full changes since v1.0.0 <https://github.com/fsoubelet/PyhDToolkit/compare/1.1.0...1.1.1>`_.
See `v1.1.1 release notes on GitHub <https://github.com/fsoubelet/PyhDToolkit/releases/tag/1.1.1>`_ and the `full changes since v1.1.0 <https://github.com/fsoubelet/PyhDToolkit/compare/1.1.0...1.1.1>`_.
45 changes: 45 additions & 0 deletions docs/releases/v1.2.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. _release_1.2.0:

1.2.0
-----

Release `1.2.0` brings some new features and dependency changes.

Changes
~~~~~~~

* The `pyhdtoolkit.plotting.envelope` functions `plot_envelope` and `plot_stay_clear` have been removed. They are replaced by a new one, `plot_beam_envelope`, which handles all enveloppe calculations directly from the `MAD-X` instance. Documentation and examples have been updated.

Enhancements
~~~~~~~~~~~~

* The `pyhdtoolkit.plotting.aperture` module has a new function, `~pyhdtoolkit.plotting.aperture.plot_physical_apertures`, to try and plot the physical apertures of elements on the given axis.
* The `pyhdtoolkit.plotting.utils` module has a new function, `~pyhdtoolkit.plotting.utils.draw_confidence_ellipse`, to plot the covariance ellipse of two arrays.
* The `pyhdtoolkit.plotting.layout.plot_machine_layout` function (and those relying on it) can now plot octupole patches.
* The `pyhdtoolkit.plotting.layout.plot_machine_layout` function (and those relying on it) can now handle single values given for ylimits of different elements in the machine layout. For instance now `k1l_lim=5e-2` is valid and equivalent to `k1l_lim=(-5e-2, 5e-2)`.
* An experimental utility function was added to split a complex-valued columns from a dataframe into two real-valued ones. It might join the public API in a future release, and is for now available as `~pyhdtoolkit.utils._misc.split_complex_columns`.
* An experimental utility function was added to add noise to the ``LHC`` *IR* BPMs in a given dataframe column. It might join the public API in a future release, and is for now available as `~pyhdtoolkit.utils._misc.add_noise_to_ir_bpms`.
* An experimental utility function was added to add noise to the ``LHC`` *arc* BPMs in a given dataframe column. It might join the public API in a future release, and is for now available as `~pyhdtoolkit.utils._misc.add_noise_to_arc_bpms`.
* The functions in the `pyhdtoolkit.cpymadtools.ptc` module can now be given values for the ``PTC`` universe creation and called commands parameters through keyword arguments. The documentation has been updated with information on the available parameters.

Bug Fixes
~~~~~~~~~

* The `pyhdtoolkit.plotting.layout.plot_machine_layout` function now only adds a legend for element patches of a certain type if at least one element was drawn.
* The `pyhdtoolkit.plotting.layout.plot_machine_layout` function now tries to properly determine legend locations based on which elements were drawn.

Documentation
~~~~~~~~~~~~~

* The documentation generated by `Sphinx` should now properly display short type hints instead of the full expanded ones.
* Some example pages have been updated to use the minimal requirement of provided **args** for the functions in `~pyhdtoolkit.cpymadtools.matching`.
* Some typos that were left in a few docstrings have been corrected.

Maintenance
~~~~~~~~~~~

* The `madx` argument is now positional only in all APIs involving it (APIs in `~pyhdtoolkit.cpymadtools` and `~pyhdtoolkit.plotting`).
* The `~numpy` dependency is now capped at version `<1.24.0`, as when using this new version some `~matplotlib` functions are broken.
* Various type hints from the `typing` module, such as `Dict` or `List`, have been superseeded by the default, now-standard builtins (such as `dict` or `list`).

See `v1.2.0 release notes on GitHub <https://github.com/fsoubelet/PyhDToolkit/releases/tag/1.2.0>`_ and the `full changes since v1.1.1 <https://github.com/fsoubelet/PyhDToolkit/compare/1.1.1...1.2.0>`_.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
! JMad export of model LHC 2022 optic R2022a_A11mC11mA10mL10m


call, file="acc-models-lhc/toolkit/zero-strengths.madx";
call, file="acc-models-lhc/strengths/ATS_Nominal/2022/ramp/ats_11m.madx";
call, file="acc-models-lhc/toolkit/reset-bump-flags.madx";
call, file="acc-models-lhc/toolkit/match-lumiknobs.madx";
call, file="acc-models-lhc/toolkit/generate-op-tune-knobs-ats.madx";
call, file="acc-models-lhc/toolkit/generate-op-chroma-knobs-ats.madx";
call, file="acc-models-lhc/toolkit/generate-op-coupling-knobs-ats.madx";
Loading