spectrochempy-hypercomplex 0.1.2__tar.gz → 0.1.3__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.
Files changed (15) hide show
  1. spectrochempy_hypercomplex-0.1.3/PKG-INFO +43 -0
  2. spectrochempy_hypercomplex-0.1.3/README.md +33 -0
  3. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/pyproject.toml +2 -1
  4. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex/__init__.py +1 -1
  5. spectrochempy_hypercomplex-0.1.3/src/spectrochempy_hypercomplex.egg-info/PKG-INFO +43 -0
  6. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex.egg-info/SOURCES.txt +1 -0
  7. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/tests/test_hypercomplex.py +57 -10
  8. spectrochempy_hypercomplex-0.1.2/PKG-INFO +0 -8
  9. spectrochempy_hypercomplex-0.1.2/src/spectrochempy_hypercomplex.egg-info/PKG-INFO +0 -8
  10. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/setup.cfg +0 -0
  11. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex/_quaternion.py +0 -0
  12. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex.egg-info/dependency_links.txt +0 -0
  13. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex.egg-info/entry_points.txt +0 -0
  14. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex.egg-info/requires.txt +0 -0
  15. {spectrochempy_hypercomplex-0.1.2 → spectrochempy_hypercomplex-0.1.3}/src/spectrochempy_hypercomplex.egg-info/top_level.txt +0 -0
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.4
2
+ Name: spectrochempy-hypercomplex
3
+ Version: 0.1.3
4
+ Summary: Hypercomplex / quaternion support plugin for SpectroChemPy
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: spectrochempy<0.10,>=0.9
8
+ Requires-Dist: numpy
9
+ Requires-Dist: numpy-quaternion>=2024.0.7
10
+
11
+ # spectrochempy-hypercomplex
12
+
13
+ Hypercomplex / quaternion support plugin for SpectroChemPy.
14
+
15
+ Provides quaternion-based dataset types, quaternion-aware processing
16
+ operations, and utilities for working with hypercomplex NMR data.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install spectrochempy[hypercomplex]
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ import spectrochempy as scp
28
+
29
+ # Enable hypercomplex support.
30
+ dataset = scp.read_topspin("path/to/2rr")
31
+ dataset.set_quaternion()
32
+ ```
33
+
34
+ This plugin requires SpectroChemPy.
35
+
36
+ ## Development
37
+
38
+ ```bash
39
+ pip install -e .
40
+ pip install -e plugins/spectrochempy-hypercomplex
41
+ cd plugins/spectrochempy-hypercomplex
42
+ python -m pytest tests/
43
+ ```
@@ -0,0 +1,33 @@
1
+ # spectrochempy-hypercomplex
2
+
3
+ Hypercomplex / quaternion support plugin for SpectroChemPy.
4
+
5
+ Provides quaternion-based dataset types, quaternion-aware processing
6
+ operations, and utilities for working with hypercomplex NMR data.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ pip install spectrochempy[hypercomplex]
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```python
17
+ import spectrochempy as scp
18
+
19
+ # Enable hypercomplex support.
20
+ dataset = scp.read_topspin("path/to/2rr")
21
+ dataset.set_quaternion()
22
+ ```
23
+
24
+ This plugin requires SpectroChemPy.
25
+
26
+ ## Development
27
+
28
+ ```bash
29
+ pip install -e .
30
+ pip install -e plugins/spectrochempy-hypercomplex
31
+ cd plugins/spectrochempy-hypercomplex
32
+ python -m pytest tests/
33
+ ```
@@ -4,9 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "spectrochempy-hypercomplex"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Hypercomplex / quaternion support plugin for SpectroChemPy"
9
9
  requires-python = ">=3.11"
10
+ readme = "README.md"
10
11
  dependencies = [
11
12
  "spectrochempy>=0.9,<0.10",
12
13
  "numpy",
@@ -310,7 +310,7 @@ class HyperComplexPlugin(SpectroChemPyPlugin):
310
310
  """Hypercomplex / quaternion support for SpectroChemPy."""
311
311
 
312
312
  name = "hypercomplex"
313
- version = "0.1.2"
313
+ version = "0.1.3"
314
314
  description = "Hypercomplex / quaternion data support"
315
315
  spectrochempy_min_version = "0.9.0"
316
316
  PLUGIN_API_VERSION = CORE_PLUGIN_API_VERSION
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.4
2
+ Name: spectrochempy-hypercomplex
3
+ Version: 0.1.3
4
+ Summary: Hypercomplex / quaternion support plugin for SpectroChemPy
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: spectrochempy<0.10,>=0.9
8
+ Requires-Dist: numpy
9
+ Requires-Dist: numpy-quaternion>=2024.0.7
10
+
11
+ # spectrochempy-hypercomplex
12
+
13
+ Hypercomplex / quaternion support plugin for SpectroChemPy.
14
+
15
+ Provides quaternion-based dataset types, quaternion-aware processing
16
+ operations, and utilities for working with hypercomplex NMR data.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install spectrochempy[hypercomplex]
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ import spectrochempy as scp
28
+
29
+ # Enable hypercomplex support.
30
+ dataset = scp.read_topspin("path/to/2rr")
31
+ dataset.set_quaternion()
32
+ ```
33
+
34
+ This plugin requires SpectroChemPy.
35
+
36
+ ## Development
37
+
38
+ ```bash
39
+ pip install -e .
40
+ pip install -e plugins/spectrochempy-hypercomplex
41
+ cd plugins/spectrochempy-hypercomplex
42
+ python -m pytest tests/
43
+ ```
@@ -1,3 +1,4 @@
1
+ README.md
1
2
  pyproject.toml
2
3
  src/spectrochempy_hypercomplex/__init__.py
3
4
  src/spectrochempy_hypercomplex/_quaternion.py
@@ -1,38 +1,85 @@
1
1
  # ruff: noqa: S101
2
+ from importlib.metadata import version
3
+
2
4
  import numpy as np
3
5
  import pytest
6
+ from spectrochempy_hypercomplex import HyperComplexPlugin
7
+
8
+ import spectrochempy as scp
9
+ from spectrochempy.api.plugins import PluginCapability
10
+ from spectrochempy.api.plugins import PluginState
11
+ from spectrochempy.api.plugins import check_plugin_compatibility
12
+ from spectrochempy.testing.plugins import PluginTestHarness
13
+
14
+
15
+ class TestPluginLifecycle:
16
+ def test_import(self):
17
+ import spectrochempy_hypercomplex # noqa: F401
18
+
19
+ def test_plugin_metadata(self):
20
+ plugin = HyperComplexPlugin()
21
+ assert plugin.name == "hypercomplex"
22
+ assert plugin.description
23
+ assert PluginCapability.ACCESSOR in plugin.capabilities
24
+
25
+ def test_plugin_version(self):
26
+ plugin = HyperComplexPlugin()
27
+ assert plugin.version
28
+ assert isinstance(plugin.version, str)
29
+ pkg_ver = version("spectrochempy-hypercomplex")
30
+ assert plugin.version == pkg_ver, (
31
+ f"Plugin version {plugin.version} != package version {pkg_ver}. "
32
+ "Run `pip install -e` to sync."
33
+ )
34
+
35
+ def test_plugin_compatibility(self):
36
+ plugin = HyperComplexPlugin()
37
+ issues = check_plugin_compatibility(plugin)
38
+ assert not issues, f"Compatibility issues: {issues}"
39
+
40
+ def test_registration(self):
41
+ harness = PluginTestHarness()
42
+ harness.register(HyperComplexPlugin())
43
+
44
+ accessors = list(harness.registry.available_accessors)
45
+ assert "hyper" in accessors
46
+
47
+ def test_lifecycle_state(self):
48
+ harness = PluginTestHarness()
49
+ harness.register(HyperComplexPlugin())
50
+ assert harness.get_plugin_state("hypercomplex") == PluginState.ACTIVE
51
+
52
+ def test_accessor_registered_via_plugin(self):
53
+ harness = PluginTestHarness()
54
+ harness.register(HyperComplexPlugin())
55
+
56
+ acc = harness.get_accessor("hyper")
57
+ assert acc is not None
58
+ assert acc["obj"] is not None
59
+ assert acc["metadata"]["plugin"] == "hypercomplex"
60
+ assert acc["metadata"]["namespace"] == "hypercomplex"
4
61
 
5
62
 
6
63
  class TestHyperAccessor:
7
64
  def test_accessor_registered(self):
8
- import spectrochempy as scp
9
-
10
65
  ds = scp.NDDataset([1.0, 2.0, 3.0])
11
66
  assert hasattr(ds, "hyper")
12
67
 
13
68
  def test_is_quaternion_false_for_real(self):
14
- import spectrochempy as scp
15
-
16
69
  ds = scp.NDDataset([1.0, 2.0, 3.0])
17
70
  assert ds.hyper.is_quaternion is False
18
71
 
19
72
  def test_set_quaternion_creates_quaternion_dtype(self):
20
- import spectrochempy as scp
21
-
22
73
  ds = scp.NDDataset([1.0, 2.0, 3.0, 4.0])
23
74
  result = ds.hyper.set_quaternion()
24
75
  assert result._data.dtype.name == "quaternion"
25
76
 
26
77
  def test_component_real_data_noop(self):
27
- import spectrochempy as scp
28
-
29
78
  ds = scp.NDDataset([1.0, 2.0, 3.0])
30
79
  result = ds.hyper.component("RR")
31
80
  assert result is not None
32
81
 
33
82
  def test_RR_RI_IR_II_raise_for_real(self):
34
- import spectrochempy as scp
35
-
36
83
  ds = scp.NDDataset([1.0, 2.0, 3.0])
37
84
  for prop in ["RR", "RI", "IR", "II"]:
38
85
  with pytest.raises(TypeError):
@@ -1,8 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: spectrochempy-hypercomplex
3
- Version: 0.1.2
4
- Summary: Hypercomplex / quaternion support plugin for SpectroChemPy
5
- Requires-Python: >=3.11
6
- Requires-Dist: spectrochempy<0.10,>=0.9
7
- Requires-Dist: numpy
8
- Requires-Dist: numpy-quaternion>=2024.0.7
@@ -1,8 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: spectrochempy-hypercomplex
3
- Version: 0.1.2
4
- Summary: Hypercomplex / quaternion support plugin for SpectroChemPy
5
- Requires-Python: >=3.11
6
- Requires-Dist: spectrochempy<0.10,>=0.9
7
- Requires-Dist: numpy
8
- Requires-Dist: numpy-quaternion>=2024.0.7