golem-toolkit 0.1.0__tar.gz

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.
@@ -0,0 +1,190 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ .venv*/
134
+ .conda/
135
+ .mamba/
136
+ .micromamba/
137
+ .pixi/
138
+ env/
139
+ venv/
140
+ ENV/
141
+ env.bak/
142
+ venv.bak/
143
+
144
+ # Spyder project settings
145
+ .spyderproject
146
+ .spyproject
147
+
148
+ # Rope project settings
149
+ .ropeproject
150
+
151
+ # mkdocs documentation
152
+ /site
153
+
154
+ # mypy
155
+ .mypy_cache/
156
+ .dmypy.json
157
+ dmypy.json
158
+
159
+ # Pyre type checker
160
+ .pyre/
161
+
162
+ # pytype static type analyzer
163
+ .pytype/
164
+
165
+ # Cython debug symbols
166
+ cython_debug/
167
+
168
+ # PyCharm
169
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
170
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
171
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
172
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
173
+ #.idea/
174
+ .vscode/
175
+
176
+ # Local shell dumps
177
+ _Empty_Source_Shells/
178
+
179
+ # Ruff stuff:
180
+ .ruff_cache/
181
+
182
+ # PyPI configuration file
183
+ .pypirc
184
+
185
+ # Cursor
186
+ # Cursor is an AI-powered code editor.`.cursorignore` specifies files/directories to
187
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
188
+ # refer to https://docs.cursor.com/context/ignore-files
189
+ .cursorignore
190
+ .cursorindexingignore
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Václav Sedmidubský
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: golem-toolkit
3
+ Version: 0.1.0
4
+ Summary: GOLEM toolkit.
5
+ Project-URL: Homepage, https://github.com/vasek7d/golem_toolkit
6
+ Project-URL: Issues, https://github.com/vasek7d/golem_toolkit/issues
7
+ Author-email: Václav Sedmidubský <vasek7d@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 Václav Sedmidubský
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: DAS,GOLEM,diagnostics,plasma,tokamak
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: Programming Language :: Python :: 3
34
+ Requires-Python: >=3.9
35
+ Requires-Dist: matplotlib
36
+ Requires-Dist: numpy
37
+ Requires-Dist: pandas
38
+ Requires-Dist: scipy
39
+ Requires-Dist: xarray
40
+ Provides-Extra: dev
41
+ Requires-Dist: build; extra == 'dev'
42
+ Requires-Dist: mypy; extra == 'dev'
43
+ Requires-Dist: pytest>=8; extra == 'dev'
44
+ Requires-Dist: ruff; extra == 'dev'
45
+ Requires-Dist: twine; extra == 'dev'
46
+ Description-Content-Type: text/markdown
47
+
48
+ # golem-toolkit
49
+
50
+ GOLEM toolkit.
51
+
52
+ ## Installation
53
+
54
+ This package is not yet available on PyPI or conda-forge. You need to download or clone the repository locally to install it.
55
+
56
+ ### Using Anaconda
57
+
58
+ 1. **Download or clone the repository** to your local machine.
59
+
60
+ 2. **Navigate to the repository directory**:
61
+ ```bash
62
+ cd golem_toolkit
63
+ ```
64
+
65
+ 3. **(Optional) Create a new conda environment** with Python >=3.9:
66
+ ```bash
67
+ conda create -n golem-toolkit python>=3.9
68
+ ```
69
+
70
+ 4. **Activate your conda environment**:
71
+ ```bash
72
+ conda activate golem-toolkit
73
+ ```
74
+
75
+ 5. **Install the package** from the local directory:
76
+
77
+ For regular installation:
78
+ ```bash
79
+ pip install .
80
+ ```
81
+
82
+ For editable/development installation (recommended for development):
83
+ ```bash
84
+ pip install -e .
85
+ ```
86
+
87
+ 6. **Optional: Install development dependencies**:
88
+ ```bash
89
+ pip install -e ".[dev]"
90
+ ```
91
+
92
+ ## Active probe IV correction
93
+
94
+ Module `golem_toolkit.probes` corrects raw shunt current (CH1) and divider output (CH2) to tip voltage and probe current using calibration NetCDF files.
95
+
96
+ ```python
97
+ from golem_toolkit.probes import load_iv_calibration, process_iv_signals
98
+
99
+ calib = load_iv_calibration("active_probe_calib.nc")
100
+ ds = process_iv_signals(I_raw, U_raw, calibration=calib, mode="ac", f0_hz=20_000.0)
101
+ # Conductance at f0: Re(ds.attrs["I_probe_phasor"] / ds.attrs["U_true_phasor"])
102
+ # IV plot: ds["U_true"] vs ds["I_probe"] (waveform keeps harmonics/noise)
103
+ ```
104
+
105
+ Documentation: [docs/probes/IV_CORRECTION.md](docs/probes/IV_CORRECTION.md), [docs/probes/NAMING.md](docs/probes/NAMING.md).
106
+
107
+ Generate calibration from circuit_test: `python active_voltage_divider_test/export_iv_calibration.py`.
108
+
109
+ ---
110
+
111
+ Licensed under the MIT License – see [LICENSE](LICENSE) for details.
@@ -0,0 +1,64 @@
1
+ # golem-toolkit
2
+
3
+ GOLEM toolkit.
4
+
5
+ ## Installation
6
+
7
+ This package is not yet available on PyPI or conda-forge. You need to download or clone the repository locally to install it.
8
+
9
+ ### Using Anaconda
10
+
11
+ 1. **Download or clone the repository** to your local machine.
12
+
13
+ 2. **Navigate to the repository directory**:
14
+ ```bash
15
+ cd golem_toolkit
16
+ ```
17
+
18
+ 3. **(Optional) Create a new conda environment** with Python >=3.9:
19
+ ```bash
20
+ conda create -n golem-toolkit python>=3.9
21
+ ```
22
+
23
+ 4. **Activate your conda environment**:
24
+ ```bash
25
+ conda activate golem-toolkit
26
+ ```
27
+
28
+ 5. **Install the package** from the local directory:
29
+
30
+ For regular installation:
31
+ ```bash
32
+ pip install .
33
+ ```
34
+
35
+ For editable/development installation (recommended for development):
36
+ ```bash
37
+ pip install -e .
38
+ ```
39
+
40
+ 6. **Optional: Install development dependencies**:
41
+ ```bash
42
+ pip install -e ".[dev]"
43
+ ```
44
+
45
+ ## Active probe IV correction
46
+
47
+ Module `golem_toolkit.probes` corrects raw shunt current (CH1) and divider output (CH2) to tip voltage and probe current using calibration NetCDF files.
48
+
49
+ ```python
50
+ from golem_toolkit.probes import load_iv_calibration, process_iv_signals
51
+
52
+ calib = load_iv_calibration("active_probe_calib.nc")
53
+ ds = process_iv_signals(I_raw, U_raw, calibration=calib, mode="ac", f0_hz=20_000.0)
54
+ # Conductance at f0: Re(ds.attrs["I_probe_phasor"] / ds.attrs["U_true_phasor"])
55
+ # IV plot: ds["U_true"] vs ds["I_probe"] (waveform keeps harmonics/noise)
56
+ ```
57
+
58
+ Documentation: [docs/probes/IV_CORRECTION.md](docs/probes/IV_CORRECTION.md), [docs/probes/NAMING.md](docs/probes/NAMING.md).
59
+
60
+ Generate calibration from circuit_test: `python active_voltage_divider_test/export_iv_calibration.py`.
61
+
62
+ ---
63
+
64
+ Licensed under the MIT License – see [LICENSE](LICENSE) for details.
@@ -0,0 +1,48 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.25", "hatch-vcs>=0.4"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "golem-toolkit"
7
+ description = "GOLEM toolkit."
8
+ readme = "README.md"
9
+ requires-python = ">=3.9"
10
+ dependencies = [
11
+ "numpy",
12
+ "pandas",
13
+ "matplotlib",
14
+ "xarray",
15
+ "scipy",
16
+ ]
17
+ license = { file = "LICENSE" }
18
+ authors = [{ name = "Václav Sedmidubský", email = "vasek7d@gmail.com" }]
19
+ dynamic = ["version"]
20
+ keywords = ["tokamak", "GOLEM", "diagnostics", "plasma", "DAS"]
21
+ classifiers = [
22
+ "Programming Language :: Python :: 3",
23
+ "License :: OSI Approved :: MIT License",
24
+ "Operating System :: OS Independent",
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/vasek7d/golem_toolkit"
29
+ Issues = "https://github.com/vasek7d/golem_toolkit/issues"
30
+
31
+ [project.optional-dependencies]
32
+ dev = ["pytest>=8", "build", "twine", "ruff", "mypy"]
33
+
34
+ [tool.hatch.build.targets.sdist]
35
+ include = ["src/golem_toolkit", "README.md", "LICENSE", "tests"]
36
+
37
+ [tool.hatch.version]
38
+ source = "vcs"
39
+
40
+ [tool.hatch.build.targets.wheel]
41
+ packages = ["src/golem_toolkit"]
42
+
43
+ [tool.pytest.ini_options]
44
+ testpaths = ["tests"]
45
+ addopts = "-q"
46
+ markers = [
47
+ "network: tests that require an internet connection",
48
+ ]
@@ -0,0 +1,5 @@
1
+ __all__ = [
2
+ "hello_package",
3
+ "loading",
4
+ "probes",
5
+ ]
@@ -0,0 +1,2 @@
1
+ def hello():
2
+ return 'Hello from test_package!'