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.
Files changed (51) hide show
  1. pymagnetos/__init__.py +15 -0
  2. pymagnetos/cli.py +40 -0
  3. pymagnetos/core/__init__.py +19 -0
  4. pymagnetos/core/_config.py +340 -0
  5. pymagnetos/core/_data.py +132 -0
  6. pymagnetos/core/_processor.py +905 -0
  7. pymagnetos/core/config_models.py +57 -0
  8. pymagnetos/core/gui/__init__.py +6 -0
  9. pymagnetos/core/gui/_base_mainwindow.py +819 -0
  10. pymagnetos/core/gui/widgets/__init__.py +19 -0
  11. pymagnetos/core/gui/widgets/_batch_processing.py +319 -0
  12. pymagnetos/core/gui/widgets/_configuration.py +167 -0
  13. pymagnetos/core/gui/widgets/_files.py +129 -0
  14. pymagnetos/core/gui/widgets/_graphs.py +93 -0
  15. pymagnetos/core/gui/widgets/_param_content.py +20 -0
  16. pymagnetos/core/gui/widgets/_popup_progressbar.py +29 -0
  17. pymagnetos/core/gui/widgets/_text_logger.py +32 -0
  18. pymagnetos/core/signal_processing.py +1004 -0
  19. pymagnetos/core/utils.py +85 -0
  20. pymagnetos/log.py +126 -0
  21. pymagnetos/py.typed +0 -0
  22. pymagnetos/pytdo/__init__.py +6 -0
  23. pymagnetos/pytdo/_config.py +24 -0
  24. pymagnetos/pytdo/_config_models.py +59 -0
  25. pymagnetos/pytdo/_tdoprocessor.py +1052 -0
  26. pymagnetos/pytdo/assets/config_default.toml +84 -0
  27. pymagnetos/pytdo/gui/__init__.py +26 -0
  28. pymagnetos/pytdo/gui/_worker.py +106 -0
  29. pymagnetos/pytdo/gui/main.py +617 -0
  30. pymagnetos/pytdo/gui/widgets/__init__.py +8 -0
  31. pymagnetos/pytdo/gui/widgets/_buttons.py +66 -0
  32. pymagnetos/pytdo/gui/widgets/_configuration.py +78 -0
  33. pymagnetos/pytdo/gui/widgets/_graphs.py +280 -0
  34. pymagnetos/pytdo/gui/widgets/_param_content.py +137 -0
  35. pymagnetos/pyuson/__init__.py +7 -0
  36. pymagnetos/pyuson/_config.py +26 -0
  37. pymagnetos/pyuson/_config_models.py +71 -0
  38. pymagnetos/pyuson/_echoprocessor.py +1901 -0
  39. pymagnetos/pyuson/assets/config_default.toml +92 -0
  40. pymagnetos/pyuson/gui/__init__.py +26 -0
  41. pymagnetos/pyuson/gui/_worker.py +135 -0
  42. pymagnetos/pyuson/gui/main.py +767 -0
  43. pymagnetos/pyuson/gui/widgets/__init__.py +7 -0
  44. pymagnetos/pyuson/gui/widgets/_buttons.py +95 -0
  45. pymagnetos/pyuson/gui/widgets/_configuration.py +85 -0
  46. pymagnetos/pyuson/gui/widgets/_graphs.py +248 -0
  47. pymagnetos/pyuson/gui/widgets/_param_content.py +193 -0
  48. pymagnetos-0.1.0.dist-info/METADATA +23 -0
  49. pymagnetos-0.1.0.dist-info/RECORD +51 -0
  50. pymagnetos-0.1.0.dist-info/WHEEL +4 -0
  51. 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]]
@@ -0,0 +1,6 @@
1
+ """Shared Graphical User Interface (GUI) components."""
2
+
3
+ from . import widgets
4
+ from ._base_mainwindow import BaseMainWindow
5
+
6
+ __all__ = ["BaseMainWindow", "widgets"]