Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c27dd5b
min version of 3.11 like scientific ecosystem, update classifiers
fsoubelet Jan 8, 2026
bcb1e6d
move rich and pendulum to monitor extra deps, propagate to tests and …
fsoubelet Jan 8, 2026
698883c
update lockfile
fsoubelet Jan 8, 2026
8a931b5
type settings dicts
fsoubelet Jan 8, 2026
1be00b4
do not expose entrypoint module in init - might be a script folder at…
fsoubelet Jan 8, 2026
9748651
declare the entrypoint as a script in metadata
fsoubelet Jan 8, 2026
df0f61e
I dont use isort and black anymore
fsoubelet Jan 8, 2026
992a368
raise if no scheduler information matched (instead of crashing)
fsoubelet Jan 8, 2026
cd7d0ed
properly escape dots in the regex
fsoubelet Jan 8, 2026
62af7b7
less greedy capture
fsoubelet Jan 8, 2026
167dda7
compile the pattern once
fsoubelet Jan 8, 2026
ac60e6e
rename and will only be utility module
fsoubelet Jan 8, 2026
7a96316
new script, barebones now, with entrypoint
fsoubelet Jan 8, 2026
5cd15f5
adapt script from project metadata to be taking from new script
fsoubelet Jan 8, 2026
2de80a1
remove old util, remove entrypoint from new util
fsoubelet Jan 8, 2026
cc40a42
remove 3.10 and add 3.14 to matrices, move 3.13 to 3.14 where its the…
fsoubelet Jan 8, 2026
880e821
turns out llvmlite does not do 3.14
fsoubelet Jan 8, 2026
153cfa9
import from new name
fsoubelet Jan 8, 2026
9f9320c
docstrings
fsoubelet Jan 8, 2026
4a67b88
extracted
fsoubelet Jan 8, 2026
be3c71e
ignore the entrypoint one
fsoubelet Jan 8, 2026
56e603b
custom exception
fsoubelet Jan 8, 2026
5c01ebf
info on expected types and proper conversion before calling model
fsoubelet Jan 8, 2026
2afcfb9
ignore this too
fsoubelet Jan 8, 2026
2383ac2
include utility module in init
fsoubelet Jan 8, 2026
adeb603
new custom exception
fsoubelet Jan 8, 2026
e166ebd
module level regex template
fsoubelet Jan 8, 2026
1dda2ce
more robust cluster summary line parsing and calling block. Much deta…
fsoubelet Jan 8, 2026
696c8df
also use named groups for this regex
fsoubelet Jan 8, 2026
8267de6
ty happy
fsoubelet Jan 8, 2026
b3b2026
some types and formatting here
fsoubelet Jan 8, 2026
49a032b
up minor version
fsoubelet Jan 8, 2026
0613fe5
add new release info to docs
fsoubelet Jan 8, 2026
0531b2b
fix module name in doc
fsoubelet Jan 8, 2026
f535eba
do not keep the same anchor
fsoubelet Jan 8, 2026
e0e5962
no more misc
fsoubelet Jan 8, 2026
1f064fe
get an anchor
fsoubelet Jan 8, 2026
411e6ac
add scripts section to docs, include HTCondor monitor and skeleton fo…
fsoubelet Jan 8, 2026
caf151d
no double title
fsoubelet Jan 8, 2026
9efd5e4
from future annotations
fsoubelet Jan 8, 2026
b190ce8
with pydantiuc model rebuild
fsoubelet Jan 8, 2026
cbab7f1
info for new functionality
fsoubelet Jan 8, 2026
40b7710
declare typer as dependency for script
fsoubelet Jan 8, 2026
ca370f4
logger.catch the generate_renderable, add CLI app from typer and firs…
fsoubelet Jan 8, 2026
feb26be
need to declare the Typer app for script metadata
fsoubelet Jan 8, 2026
2ab323c
options
fsoubelet Jan 8, 2026
a108bea
Specific error raised when condor_q fails us
fsoubelet Jan 8, 2026
24e6090
no catching with logger, except more cases to handle
fsoubelet Jan 8, 2026
90da344
little more info
fsoubelet Jan 8, 2026
8fab5c4
combine two console logs
fsoubelet Jan 8, 2026
21c1563
attempt to have a progress bar for the waiting time
fsoubelet Jan 8, 2026
cc27fbf
also min values
fsoubelet Jan 8, 2026
2e01e57
include progress bar
fsoubelet Jan 8, 2026
805c85d
progress bar above table layout maker
fsoubelet Jan 8, 2026
1c84824
[WIP] reusable console and progress bar
fsoubelet Jan 8, 2026
ca8dddc
[WIP] once per cycle tasks
fsoubelet Jan 8, 2026
6cf9ed7
[WIP] progress bar updates and re rendering
fsoubelet Jan 8, 2026
0fb4af1
formnatting
fsoubelet Jan 8, 2026
f32bf82
[WIP] adapt sleep interval, dont recreate the layout so much
fsoubelet Jan 8, 2026
a9d73aa
[wIP] should be max
fsoubelet Jan 8, 2026
feb8ca9
[wIP] taking the table width maybe
fsoubelet Jan 8, 2026
5e6cce8
[WIP] new make layout takes the console too
fsoubelet Jan 8, 2026
acce2ca
[WIP] renaming
fsoubelet Jan 8, 2026
6f59f9e
[WIP] adapt call here
fsoubelet Jan 8, 2026
71ad4ac
[WIP] remove unused code
fsoubelet Jan 8, 2026
8769a03
[WIP] use rich.measure.Measurement
fsoubelet Jan 8, 2026
bb1ac9b
[WIPPP] dopnt care for the panel, though it was the right size
fsoubelet Jan 8, 2026
78e36a8
no panel, relative sizes, bold main text
fsoubelet Jan 8, 2026
632d21d
left align
fsoubelet Jan 8, 2026
3cb1187
docstring
fsoubelet Jan 8, 2026
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/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-latest, windows-latest]
# We escape with quotes so it doesn't get interpreted as float (e.g. 3.10 -> 3.1 by GA's parser)
python-version: ["3.10", "3.11", "3.12", "3.13"] # add new versions when they are released
python-version: ["3.11", "3.12", "3.13"] # add new versions when they are released
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-latest, windows-latest]
# We escape with quotes so it doesn't get interpreted as float (e.g. 3.10 -> 3.1 by GA's parser)
python-version: ["3.10", "3.11", "3.12", "3.13"] # add new versions when they are released
python-version: ["3.11", "3.12", "3.13"] # add new versions when they are released
fail-fast: false

steps:
Expand Down
4 changes: 3 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.. _api-top:

API Reference
=============

.. toctree::
:maxdepth: 2
:glob:

api/*
6 changes: 1 addition & 5 deletions docs/api/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ Utils
:members:
:noindex:

.. automodule:: pyhdtoolkit.utils.htc_monitor
.. automodule:: pyhdtoolkit.utils.htcondor
:members:
:noindex:

.. automodule:: pyhdtoolkit.utils.logging
:members:
:noindex:

.. .. automodule:: pyhdtoolkit.utils._misc
.. :members:
.. :noindex:
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Contents

quickstart
gallery/index
scripts
api
contributing
release
Expand Down Expand Up @@ -121,7 +122,7 @@ The following people have contributed to the development of PyhDToolkit by contr
License
-------

The package is licensed under the `MIT license <https://github.com/fsoubelet/PyhDToolkit/blob/master/LICENSE>`_.
The package is licensed under the `MIT license <https://github.com/fsoubelet/PyhDToolkit/blob/master/LICENSE>`_.

Indices and tables
------------------
Expand Down
8 changes: 8 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ 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.8.0
-------------

.. toctree::
:maxdepth: 2

releases/v1.8.0

Version 1.7.0
-------------

Expand Down
35 changes: 35 additions & 0 deletions docs/releases/v1.8.0.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _release_1.8.0:

Release `1.8.0` brings some project maintenance and a complete refactor of the `HTCondor`-related utilities from the package.

Removals
~~~~~~~~

* The `pyhdtoolkit.utils.htc_monitor` module has been removed, and its functionality split.

Additions
~~~~~~~~~

* A new module, `pyhdtoolkit.utils.htcondor`, has been created to host all `HTCondor`-related utilities. The previous `htc_monitor` module's functionality has been moved here, with some improvements.
* A new command-line script, `htcondor-monitor`, has been added to provide an easy way to monitor `HTCondor` clusters from the terminal. It contains the entrypoint from the previous `pyhdtoolkit.utils.htc_monitor` module, adapted to the new module structure.
* The new script allows passing command-line options to customize its behavior (see its documentation and help message for details).
* The new scripts provides a progress bar while waiting between `condor_q` calls.
* The new script is declared as `htc-monitor` in the project metadata. It can be called simply as `htc-monitor` at the command line in an environment where `PyhDToolkit` is installed.

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

* The regex parsing in the `HTCondor` utilities has been made more robust.
* The whole package now consistently makes use of postponed evaluations of annotations (see PEP 563).

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

* The documentation has been adapted to reflect the new module structure and command-line script.

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

* Updated Continuous Integration workflows to switch to `uv`, speeding up CI runs.

See `v1.8.0 release notes on GitHub <https://github.com/fsoubelet/PyhDToolkit/releases/tag/1.8.0>`_ and the `full changes since v1.7.0 <https://github.com/fsoubelet/PyhDToolkit/compare/1.7.0...1.8.0>`_.
8 changes: 8 additions & 0 deletions docs/script/htc_monitor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _pyhdtoolkit-script-htcmonitor:

HTCondor Monitor
================

.. automodule:: pyhdtoolkit.scripts.htc_monitor
:members:
:noindex:
17 changes: 17 additions & 0 deletions docs/scripts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.. _scripts-top:

Command Line Scripts
====================

We provide a set of small command line utilities within `PyhDToolkit`.
Please note that scripts might require optional dependencies to be installed.

Each script is registered in the project's metadata and will be callable from the command line with a simplified name after installing the package in your environment.
For more information on each script such as required extras, registered name, options and examples, please refer to their dedicated documentation page.
The following scripts are currently available:

.. toctree::
:maxdepth: 2
:glob:

script/*
2 changes: 2 additions & 0 deletions pyhdtoolkit/cpymadtools/_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
gallery <gallery>`.
"""

from __future__ import annotations

# ----- Utlites ----- #


Expand Down
2 changes: 2 additions & 0 deletions pyhdtoolkit/cpymadtools/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
to help with consistency.
"""

from __future__ import annotations

_MAX_SECTOR_VALUE: int = 8

# fmt: off
Expand Down
2 changes: 2 additions & 0 deletions pyhdtoolkit/models/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
data structures relative to particle beams.
"""

from __future__ import annotations

from math import sqrt

from pydantic import BaseModel
Expand Down
20 changes: 15 additions & 5 deletions pyhdtoolkit/models/htc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
data obtained by querying the ``HTCondor`` queue.
"""

from pendulum import DateTime
from __future__ import annotations

# Do not move DateTime import into a TYPE_CHECKING block, since
# we need it defined to rebuild the pydantic model for validation
# (this is required when using from __future__ import annotations)
from pendulum import DateTime # noqa: TC002
from pydantic import BaseModel, ConfigDict


Expand Down Expand Up @@ -55,10 +60,15 @@ class HTCTaskSummary(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)

owner: str
batch_name: int
batch_name: int # only keep the part after 'ID:'
submitted: DateTime
done: int | str
run: int | str
idle: int | str
done: int | str # can be "-" if jobs in other state
run: int | str # can be "-" if jobs in other state
idle: int | str # can be "-" if jobs in other state
total: int
job_ids: str


# This is necessary to make pydantic recognize the DateTime type
# from pendulum when using from __future__ import annotations
HTCTaskSummary.model_rebuild()
2 changes: 2 additions & 0 deletions pyhdtoolkit/models/madx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
through `cpymad`.
"""

from __future__ import annotations

from enum import Enum

from pydantic import BaseModel, PositiveFloat, PositiveInt
Expand Down
2 changes: 2 additions & 0 deletions pyhdtoolkit/optics/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
simple beam parameter calculations.
"""

from __future__ import annotations

import numpy as np
from scipy import constants

Expand Down
2 changes: 2 additions & 0 deletions pyhdtoolkit/optics/rdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
resonance driving terms.
"""

from __future__ import annotations


def rdt_to_order_and_type(rdt: int | str) -> str:
"""
Expand Down
2 changes: 2 additions & 0 deletions pyhdtoolkit/optics/twiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Module implementing various calculations based on the ``TWISS`` optics parameters.
"""

from __future__ import annotations

import numpy as np


Expand Down
Loading