tsyganenkomodels-jl 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.
- tsyganenkomodels_jl-0.1.0/PKG-INFO +54 -0
- tsyganenkomodels_jl-0.1.0/README.md +38 -0
- tsyganenkomodels_jl-0.1.0/pyproject.toml +62 -0
- tsyganenkomodels_jl-0.1.0/src/tsyganenkomodels/__init__.py +39 -0
- tsyganenkomodels_jl-0.1.0/tests/__init__.py +0 -0
- tsyganenkomodels_jl-0.1.0/tests/test_wrapper.py +19 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tsyganenkomodels-jl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python wrapper for TsyganenkoModels.jl - access Tsyganenko magnetic field models via Julia
|
|
5
|
+
Keywords: tsyganenko,julia,space-physics,geomagnetism
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Intended Audience :: Science/Research
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
11
|
+
Project-URL: Homepage, https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl
|
|
12
|
+
Project-URL: Repository, https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl
|
|
13
|
+
Requires-Python: >=3.9
|
|
14
|
+
Requires-Dist: juliacall>=0.9.20
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# TsyganenkoModels
|
|
18
|
+
|
|
19
|
+
Python wrapper for [TsyganenkoModels.jl](https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl) - evaluate Tsyganenko external magnetic field models from Python.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install tsyganenkomodels-jl
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The Julia package installs automatically on first use.
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import tsyganenkomodels as tm
|
|
33
|
+
import datetime
|
|
34
|
+
|
|
35
|
+
# Compute the dipole tilt angle (radians)
|
|
36
|
+
ps = tm.dipole_tilt(datetime.datetime(2001, 1, 1, 2, 3, 4))
|
|
37
|
+
|
|
38
|
+
# Instantiate a model and evaluate GSM field (nT)
|
|
39
|
+
model = tm.T96(pdyn=2.0, dst=-87.0, byimf=2.0, bzimf=-5.0)
|
|
40
|
+
b = model([-5.1, 0.3, 2.8], ps)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## API
|
|
44
|
+
|
|
45
|
+
Available constructors/functions mirror the Julia package:
|
|
46
|
+
|
|
47
|
+
- `T89(iopt)`
|
|
48
|
+
- `T96(pdyn, dst, byimf, bzimf)`
|
|
49
|
+
- `T01(pdyn, dst, byimf, bzimf, g1=0.0, g2=0.0)`
|
|
50
|
+
- `TS04(pdyn, dst, byimf, bzimf, g1, g2, g3, w1, w2, w3, w4, w5, w6)`
|
|
51
|
+
- `t89`, `t96`, `t01`, `ts04` (functional wrappers)
|
|
52
|
+
- `dipole_tilt(t)`
|
|
53
|
+
|
|
54
|
+
See the [TsyganenkoModels.jl documentation](https://JuliaSpacePhysics.github.io/TsyganenkoModels.jl) for full details.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# TsyganenkoModels
|
|
2
|
+
|
|
3
|
+
Python wrapper for [TsyganenkoModels.jl](https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl) - evaluate Tsyganenko external magnetic field models from Python.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install tsyganenkomodels-jl
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The Julia package installs automatically on first use.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
import tsyganenkomodels as tm
|
|
17
|
+
import datetime
|
|
18
|
+
|
|
19
|
+
# Compute the dipole tilt angle (radians)
|
|
20
|
+
ps = tm.dipole_tilt(datetime.datetime(2001, 1, 1, 2, 3, 4))
|
|
21
|
+
|
|
22
|
+
# Instantiate a model and evaluate GSM field (nT)
|
|
23
|
+
model = tm.T96(pdyn=2.0, dst=-87.0, byimf=2.0, bzimf=-5.0)
|
|
24
|
+
b = model([-5.1, 0.3, 2.8], ps)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## API
|
|
28
|
+
|
|
29
|
+
Available constructors/functions mirror the Julia package:
|
|
30
|
+
|
|
31
|
+
- `T89(iopt)`
|
|
32
|
+
- `T96(pdyn, dst, byimf, bzimf)`
|
|
33
|
+
- `T01(pdyn, dst, byimf, bzimf, g1=0.0, g2=0.0)`
|
|
34
|
+
- `TS04(pdyn, dst, byimf, bzimf, g1, g2, g3, w1, w2, w3, w4, w5, w6)`
|
|
35
|
+
- `t89`, `t96`, `t01`, `ts04` (functional wrappers)
|
|
36
|
+
- `dipole_tilt(t)`
|
|
37
|
+
|
|
38
|
+
See the [TsyganenkoModels.jl documentation](https://JuliaSpacePhysics.github.io/TsyganenkoModels.jl) for full details.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tsyganenkomodels-jl"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python wrapper for TsyganenkoModels.jl - access Tsyganenko magnetic field models via Julia"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">=3.9"
|
|
8
|
+
keywords = [
|
|
9
|
+
"tsyganenko",
|
|
10
|
+
"julia",
|
|
11
|
+
"space-physics",
|
|
12
|
+
"geomagnetism",
|
|
13
|
+
]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"juliacall>=0.9.20",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl"
|
|
26
|
+
Repository = "https://github.com/JuliaSpacePhysics/TsyganenkoModels.jl"
|
|
27
|
+
|
|
28
|
+
[build-system]
|
|
29
|
+
requires = [
|
|
30
|
+
"pdm-backend",
|
|
31
|
+
]
|
|
32
|
+
build-backend = "pdm.backend"
|
|
33
|
+
|
|
34
|
+
[tool.pdm.build]
|
|
35
|
+
includes = [
|
|
36
|
+
"src/tsyganenkomodels",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.pixi.workspace]
|
|
40
|
+
channels = [
|
|
41
|
+
"conda-forge",
|
|
42
|
+
]
|
|
43
|
+
platforms = [
|
|
44
|
+
"linux-64",
|
|
45
|
+
"osx-arm64",
|
|
46
|
+
"osx-64",
|
|
47
|
+
"win-64",
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[tool.pixi.dependencies]
|
|
51
|
+
pdm = "*"
|
|
52
|
+
|
|
53
|
+
[tool.pixi.pypi-dependencies]
|
|
54
|
+
pytest = "*"
|
|
55
|
+
twine = "*"
|
|
56
|
+
|
|
57
|
+
[tool.pixi.pypi-dependencies.tsyganenkomodels-jl]
|
|
58
|
+
path = "."
|
|
59
|
+
editable = true
|
|
60
|
+
|
|
61
|
+
[tool.pixi.tasks]
|
|
62
|
+
test = "pytest"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Python wrapper for TsyganenkoModels.jl."""
|
|
2
|
+
|
|
3
|
+
from juliacall import Main as jl
|
|
4
|
+
|
|
5
|
+
# Load the Julia package
|
|
6
|
+
jl.seval("using TsyganenkoModels")
|
|
7
|
+
|
|
8
|
+
# Re-export Julia functions
|
|
9
|
+
t89 = jl.TsyganenkoModels.t89
|
|
10
|
+
t96 = jl.TsyganenkoModels.t96
|
|
11
|
+
t01 = jl.TsyganenkoModels.t01
|
|
12
|
+
ts04 = jl.TsyganenkoModels.ts04
|
|
13
|
+
dipole_tilt = jl.TsyganenkoModels.dipole_tilt
|
|
14
|
+
|
|
15
|
+
# Model constructors/types
|
|
16
|
+
T89 = jl.TsyganenkoModels.T89
|
|
17
|
+
T96 = jl.TsyganenkoModels.T96
|
|
18
|
+
T01 = jl.TsyganenkoModels.T01
|
|
19
|
+
TS04 = jl.TsyganenkoModels.TS04
|
|
20
|
+
TsyIGRF = jl.TsyganenkoModels.TsyIGRF
|
|
21
|
+
IGRF = jl.TsyganenkoModels.IGRF
|
|
22
|
+
|
|
23
|
+
__version__ = "0.1.0"
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"t89",
|
|
27
|
+
"t96",
|
|
28
|
+
"t01",
|
|
29
|
+
"ts04",
|
|
30
|
+
"dipole_tilt",
|
|
31
|
+
"T89",
|
|
32
|
+
"T96",
|
|
33
|
+
"T01",
|
|
34
|
+
"TS04",
|
|
35
|
+
"TsyIGRF",
|
|
36
|
+
"IGRF",
|
|
37
|
+
"__version__",
|
|
38
|
+
"jl",
|
|
39
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_import():
|
|
5
|
+
import tsyganenkomodels as tm
|
|
6
|
+
|
|
7
|
+
assert hasattr(tm, "T96")
|
|
8
|
+
assert hasattr(tm, "t96")
|
|
9
|
+
assert hasattr(tm, "dipole_tilt")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_basic_eval():
|
|
13
|
+
import tsyganenkomodels as tm
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
ps = tm.dipole_tilt(datetime.datetime(2001, 1, 1, 2, 3, 4))
|
|
17
|
+
model = tm.T96(pdyn=2.0, dst=-87.0, byimf=2.0, bzimf=-5.0)
|
|
18
|
+
b = model([-5.1,0.3,2.8], ps)
|
|
19
|
+
assert len(b) == 3
|