pymagnetos 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pymagnetos/__init__.py +15 -0
- pymagnetos/cli.py +40 -0
- pymagnetos/core/__init__.py +19 -0
- pymagnetos/core/_config.py +340 -0
- pymagnetos/core/_data.py +132 -0
- pymagnetos/core/_processor.py +905 -0
- pymagnetos/core/config_models.py +57 -0
- pymagnetos/core/gui/__init__.py +6 -0
- pymagnetos/core/gui/_base_mainwindow.py +819 -0
- pymagnetos/core/gui/widgets/__init__.py +19 -0
- pymagnetos/core/gui/widgets/_batch_processing.py +319 -0
- pymagnetos/core/gui/widgets/_configuration.py +167 -0
- pymagnetos/core/gui/widgets/_files.py +129 -0
- pymagnetos/core/gui/widgets/_graphs.py +93 -0
- pymagnetos/core/gui/widgets/_param_content.py +20 -0
- pymagnetos/core/gui/widgets/_popup_progressbar.py +29 -0
- pymagnetos/core/gui/widgets/_text_logger.py +32 -0
- pymagnetos/core/signal_processing.py +1004 -0
- pymagnetos/core/utils.py +85 -0
- pymagnetos/log.py +126 -0
- pymagnetos/py.typed +0 -0
- pymagnetos/pytdo/__init__.py +6 -0
- pymagnetos/pytdo/_config.py +24 -0
- pymagnetos/pytdo/_config_models.py +59 -0
- pymagnetos/pytdo/_tdoprocessor.py +1052 -0
- pymagnetos/pytdo/assets/config_default.toml +84 -0
- pymagnetos/pytdo/gui/__init__.py +26 -0
- pymagnetos/pytdo/gui/_worker.py +106 -0
- pymagnetos/pytdo/gui/main.py +617 -0
- pymagnetos/pytdo/gui/widgets/__init__.py +8 -0
- pymagnetos/pytdo/gui/widgets/_buttons.py +66 -0
- pymagnetos/pytdo/gui/widgets/_configuration.py +78 -0
- pymagnetos/pytdo/gui/widgets/_graphs.py +280 -0
- pymagnetos/pytdo/gui/widgets/_param_content.py +137 -0
- pymagnetos/pyuson/__init__.py +7 -0
- pymagnetos/pyuson/_config.py +26 -0
- pymagnetos/pyuson/_config_models.py +71 -0
- pymagnetos/pyuson/_echoprocessor.py +1901 -0
- pymagnetos/pyuson/assets/config_default.toml +92 -0
- pymagnetos/pyuson/gui/__init__.py +26 -0
- pymagnetos/pyuson/gui/_worker.py +135 -0
- pymagnetos/pyuson/gui/main.py +767 -0
- pymagnetos/pyuson/gui/widgets/__init__.py +7 -0
- pymagnetos/pyuson/gui/widgets/_buttons.py +95 -0
- pymagnetos/pyuson/gui/widgets/_configuration.py +85 -0
- pymagnetos/pyuson/gui/widgets/_graphs.py +248 -0
- pymagnetos/pyuson/gui/widgets/_param_content.py +193 -0
- pymagnetos-0.1.0.dist-info/METADATA +23 -0
- pymagnetos-0.1.0.dist-info/RECORD +51 -0
- pymagnetos-0.1.0.dist-info/WHEEL +4 -0
- pymagnetos-0.1.0.dist-info/entry_points.txt +7 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Shared Pydantic models for configuration.
|
|
3
|
+
|
|
4
|
+
Each model corresponds to a section in the configuration file.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any, Literal
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, ValidationInfo, field_validator
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class File(BaseModel):
|
|
13
|
+
"""Binary or text file."""
|
|
14
|
+
|
|
15
|
+
ext: str
|
|
16
|
+
header: int
|
|
17
|
+
|
|
18
|
+
# For binary file
|
|
19
|
+
precision: int | None = None
|
|
20
|
+
endian: Literal["<", ">"] | None = None
|
|
21
|
+
order: Literal["C", "F"] | None = None
|
|
22
|
+
|
|
23
|
+
# For text file
|
|
24
|
+
delimiter: str | None = None
|
|
25
|
+
|
|
26
|
+
@field_validator("precision", "endian", "order", "delimiter")
|
|
27
|
+
@classmethod
|
|
28
|
+
def disallow_none(
|
|
29
|
+
cls,
|
|
30
|
+
value: int | str | Literal["<", ">"] | Literal["C", "F"],
|
|
31
|
+
info: ValidationInfo,
|
|
32
|
+
):
|
|
33
|
+
"""Prevent setting None explicitely."""
|
|
34
|
+
assert value is not None, f"{info.field_name} can't be None"
|
|
35
|
+
return value
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class Parameters(BaseModel):
|
|
39
|
+
"""Parameters section, things related to the experiment itself."""
|
|
40
|
+
|
|
41
|
+
pickup_surface: float
|
|
42
|
+
pickup_number: int
|
|
43
|
+
pickup_index: int
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class Metadata(BaseModel):
|
|
47
|
+
"""Metadata section, defining how to read the metadata from files."""
|
|
48
|
+
|
|
49
|
+
index_map: dict[str, int]
|
|
50
|
+
conversion_map: dict[str, bool]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class Nexus(BaseModel):
|
|
54
|
+
"""The NeXus section, that sets the HDF5 group and dataset base names."""
|
|
55
|
+
|
|
56
|
+
groups: dict[str, dict[str, Any]]
|
|
57
|
+
datasets: dict[str, dict[str, Any]]
|