spcm-core 0.0.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.
- spcm_core-0.0.3/LICENSE +19 -0
- spcm_core-0.0.3/MANIFEST.in +2 -0
- spcm_core-0.0.3/PKG-INFO +92 -0
- spcm_core-0.0.3/README.md +59 -0
- spcm_core-0.0.3/pyproject.toml +54 -0
- spcm_core-0.0.3/setup.cfg +4 -0
- spcm_core-0.0.3/setup.py +12 -0
- spcm_core-0.0.3/src/spcm_core/__init__.py +35 -0
- spcm_core-0.0.3/src/spcm_core/_version.py +21 -0
- spcm_core-0.0.3/src/spcm_core/constants.py +6 -0
- spcm_core-0.0.3/src/spcm_core/pyspcm.py +364 -0
- spcm_core-0.0.3/src/spcm_core/regs.py +3296 -0
- spcm_core-0.0.3/src/spcm_core/spcerr.py +84 -0
- spcm_core-0.0.3/src/spcm_core/spcm_tools.py +27 -0
- spcm_core-0.0.3/src/spcm_core.egg-info/PKG-INFO +92 -0
- spcm_core-0.0.3/src/spcm_core.egg-info/SOURCES.txt +17 -0
- spcm_core-0.0.3/src/spcm_core.egg-info/dependency_links.txt +1 -0
- spcm_core-0.0.3/src/spcm_core.egg-info/top_level.txt +1 -0
- spcm_core-0.0.3/versioneer.py +2277 -0
spcm_core-0.0.3/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2023 Spectrum Instrumentation GmbH
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
spcm_core-0.0.3/PKG-INFO
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: spcm_core
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Low-level Python API Package for Spectrum Instrumentation GmbH cards
|
|
5
|
+
Author-email: Spectrum Instrumentation GmbH <info@spec.de>
|
|
6
|
+
Project-URL: Homepage, https://spectrum-instrumentation.com/
|
|
7
|
+
Project-URL: API, https://spectruminstrumentation.github.io/spcm-core/spcm_core.html
|
|
8
|
+
Project-URL: Repository, https://github.com/SpectrumInstrumentation/spcm-core
|
|
9
|
+
Project-URL: Knowledge Base, https://spectrum-instrumentation.com/support/knowledgebase/index.php
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 2.6
|
|
19
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Topic :: Scientific/Engineering
|
|
29
|
+
Classifier: Topic :: System :: Hardware
|
|
30
|
+
Requires-Python: >=2.6
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
|
|
34
|
+
<div style="margin-bottom: 20px; text-align: center">
|
|
35
|
+
<a href="https://spectrum-instrumentation.com">
|
|
36
|
+
<img src="https://spectrum-instrumentation.com/img/logo-complete.png" width=400 />
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
# spcm_core
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
[](https://pypi.org/project/spcm_core)
|
|
43
|
+
[](https://pypi.org/project/spcm_core)
|
|
44
|
+
[](https://twitter.com/SpecInstruments/)
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
A low-level, Python API package for interfacing with Spectrum Instrumentation GmbH devices.
|
|
48
|
+
|
|
49
|
+
`spcm_core` can handle individual cards, StarHubs, groups of cards and Netboxes.
|
|
50
|
+
|
|
51
|
+
# Supported devices
|
|
52
|
+
|
|
53
|
+
See the [SUPPORTED_DEVICES.md](https://github.com/SpectrumInstrumentation/spcm_core/blob/master/src/spcm_core/SUPPORTED_DEVICES.md) file for a list of supported devices.
|
|
54
|
+
|
|
55
|
+
# Requirements
|
|
56
|
+
[](https://www.python.org/)
|
|
57
|
+
[](https://numpy.org/)
|
|
58
|
+
[](https://www.h5py.org/)
|
|
59
|
+
[](https://pint.readthedocs.io/en/stable/)
|
|
60
|
+
|
|
61
|
+
`spcm_core` requires the Spectrum Instrumentation [driver](https://spectrum-instrumentation.com/support/downloads.php) which is available for Windows and Linux.
|
|
62
|
+
Please have a look in the manual of your product for more information about installing the driver on the different plattforms.
|
|
63
|
+
|
|
64
|
+
# Installation and dependencies
|
|
65
|
+
[](https://pypi.org/project/spcm_core)
|
|
66
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-publish-to-pypi.yml)
|
|
67
|
+
|
|
68
|
+
Start by installing Python 2.6 or higher. We recommend using the latest version. You can download Python from [https://www.python.org/](https://www.python.org/).
|
|
69
|
+
|
|
70
|
+
You would probably also like to install and use a virtual environment, although it's not strictly necessary. See the examples [README.md](https://github.com/SpectrumInstrumentation/spcm_core/blob/master/src/examples/README.md) for a more detailed explanation on how to use `spcm_core` in a virtual environment.
|
|
71
|
+
|
|
72
|
+
To install the latest release using `pip`:
|
|
73
|
+
```bash
|
|
74
|
+
$ pip install spcm_core
|
|
75
|
+
```
|
|
76
|
+
Note that: this will automatically install all the dependencies.
|
|
77
|
+
|
|
78
|
+
# Documentation
|
|
79
|
+
[](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html)
|
|
80
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml)
|
|
81
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/pages/pages-build-deployment)
|
|
82
|
+
|
|
83
|
+
The API documentation for the latest [stable release](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html) is available for reading on GitHub pages.
|
|
84
|
+
|
|
85
|
+
Please also see the hardware user manual for your specific card for more information about the available functionality.
|
|
86
|
+
|
|
87
|
+
# Using spcm_core
|
|
88
|
+
|
|
89
|
+
The `spcm_core` package is a high-level object-oriented programming library for controlling Spectrum Instrumentation devices.
|
|
90
|
+
|
|
91
|
+
## Examples
|
|
92
|
+
For detailed examples see the `src\examples` directory. There are several sub-directories each corresponding to a certain kind of functionality. You can find the most recent examples on [GitHub](https://github.com/SpectrumInstrumentation/spcm_core/tree/master/src/examples).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<div style="margin-bottom: 20px; text-align: center">
|
|
2
|
+
<a href="https://spectrum-instrumentation.com">
|
|
3
|
+
<img src="https://spectrum-instrumentation.com/img/logo-complete.png" width=400 />
|
|
4
|
+
</a>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
# spcm_core
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://pypi.org/project/spcm_core)
|
|
10
|
+
[](https://pypi.org/project/spcm_core)
|
|
11
|
+
[](https://twitter.com/SpecInstruments/)
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
A low-level, Python API package for interfacing with Spectrum Instrumentation GmbH devices.
|
|
15
|
+
|
|
16
|
+
`spcm_core` can handle individual cards, StarHubs, groups of cards and Netboxes.
|
|
17
|
+
|
|
18
|
+
# Supported devices
|
|
19
|
+
|
|
20
|
+
See the [SUPPORTED_DEVICES.md](https://github.com/SpectrumInstrumentation/spcm_core/blob/master/src/spcm_core/SUPPORTED_DEVICES.md) file for a list of supported devices.
|
|
21
|
+
|
|
22
|
+
# Requirements
|
|
23
|
+
[](https://www.python.org/)
|
|
24
|
+
[](https://numpy.org/)
|
|
25
|
+
[](https://www.h5py.org/)
|
|
26
|
+
[](https://pint.readthedocs.io/en/stable/)
|
|
27
|
+
|
|
28
|
+
`spcm_core` requires the Spectrum Instrumentation [driver](https://spectrum-instrumentation.com/support/downloads.php) which is available for Windows and Linux.
|
|
29
|
+
Please have a look in the manual of your product for more information about installing the driver on the different plattforms.
|
|
30
|
+
|
|
31
|
+
# Installation and dependencies
|
|
32
|
+
[](https://pypi.org/project/spcm_core)
|
|
33
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-publish-to-pypi.yml)
|
|
34
|
+
|
|
35
|
+
Start by installing Python 2.6 or higher. We recommend using the latest version. You can download Python from [https://www.python.org/](https://www.python.org/).
|
|
36
|
+
|
|
37
|
+
You would probably also like to install and use a virtual environment, although it's not strictly necessary. See the examples [README.md](https://github.com/SpectrumInstrumentation/spcm_core/blob/master/src/examples/README.md) for a more detailed explanation on how to use `spcm_core` in a virtual environment.
|
|
38
|
+
|
|
39
|
+
To install the latest release using `pip`:
|
|
40
|
+
```bash
|
|
41
|
+
$ pip install spcm_core
|
|
42
|
+
```
|
|
43
|
+
Note that: this will automatically install all the dependencies.
|
|
44
|
+
|
|
45
|
+
# Documentation
|
|
46
|
+
[](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html)
|
|
47
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml)
|
|
48
|
+
[](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/pages/pages-build-deployment)
|
|
49
|
+
|
|
50
|
+
The API documentation for the latest [stable release](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html) is available for reading on GitHub pages.
|
|
51
|
+
|
|
52
|
+
Please also see the hardware user manual for your specific card for more information about the available functionality.
|
|
53
|
+
|
|
54
|
+
# Using spcm_core
|
|
55
|
+
|
|
56
|
+
The `spcm_core` package is a high-level object-oriented programming library for controlling Spectrum Instrumentation devices.
|
|
57
|
+
|
|
58
|
+
## Examples
|
|
59
|
+
For detailed examples see the `src\examples` directory. There are several sub-directories each corresponding to a certain kind of functionality. You can find the most recent examples on [GitHub](https://github.com/SpectrumInstrumentation/spcm_core/tree/master/src/examples).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools", "wheel", "versioneer[toml]"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
dynamic = ["version"]
|
|
7
|
+
name = "spcm_core"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name='Spectrum Instrumentation GmbH', email='info@spec.de' },
|
|
10
|
+
]
|
|
11
|
+
description = "Low-level Python API Package for Spectrum Instrumentation GmbH cards"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=2.6"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Natural Language :: English",
|
|
20
|
+
"Operating System :: POSIX :: Linux",
|
|
21
|
+
"Operating System :: Microsoft :: Windows",
|
|
22
|
+
"Programming Language :: Python",
|
|
23
|
+
"Programming Language :: Python :: 2.6",
|
|
24
|
+
"Programming Language :: Python :: 2.7",
|
|
25
|
+
"Programming Language :: Python :: 3.6",
|
|
26
|
+
"Programming Language :: Python :: 3.7",
|
|
27
|
+
"Programming Language :: Python :: 3.8",
|
|
28
|
+
"Programming Language :: Python :: 3.9",
|
|
29
|
+
"Programming Language :: Python :: 3.10",
|
|
30
|
+
"Programming Language :: Python :: 3.11",
|
|
31
|
+
"Programming Language :: Python :: 3.12",
|
|
32
|
+
"Programming Language :: Python :: 3.13",
|
|
33
|
+
"Topic :: Scientific/Engineering",
|
|
34
|
+
"Topic :: System :: Hardware",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://spectrum-instrumentation.com/"
|
|
40
|
+
API = "https://spectruminstrumentation.github.io/spcm-core/spcm_core.html"
|
|
41
|
+
Repository = "https://github.com/SpectrumInstrumentation/spcm-core"
|
|
42
|
+
# Examples = "https://github.com/SpectrumInstrumentation/spcm-core/tree/master/src/examples"
|
|
43
|
+
"Knowledge Base" = "https://spectrum-instrumentation.com/support/knowledgebase/index.php"
|
|
44
|
+
|
|
45
|
+
[tool.setuptools.packages.find]
|
|
46
|
+
where = ["src"]
|
|
47
|
+
include = ["spcm_core"]
|
|
48
|
+
namespaces = false
|
|
49
|
+
|
|
50
|
+
[tool.versioneer]
|
|
51
|
+
VCS = "git"
|
|
52
|
+
style = "pep440"
|
|
53
|
+
versionfile_source = "src/spcm_core/_version.py"
|
|
54
|
+
tag_prefix = "v"
|
spcm_core-0.0.3/setup.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. include:: ./README.md
|
|
3
|
+
|
|
4
|
+
.. include:: ./SUPPORTED_DEVICES.md
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Import all registery entries and spectrum card errors into the module's name space
|
|
8
|
+
from .constants import *
|
|
9
|
+
from .pyspcm import *
|
|
10
|
+
from .spcm_tools import *
|
|
11
|
+
|
|
12
|
+
# Versioning support using versioneer
|
|
13
|
+
from . import _version
|
|
14
|
+
__version__ = _version.get_versions()['version']
|
|
15
|
+
|
|
16
|
+
# Writing spcm_core package version to log file
|
|
17
|
+
try:
|
|
18
|
+
#from .pyspcm import spcm_dwGetParam_i64, spcm_dwSetParam_ptr, create_string_buffer, byref, int64
|
|
19
|
+
driver_version = int64(0)
|
|
20
|
+
spcm_dwGetParam_i64(None, SPC_GETDRVVERSION, byref(driver_version))
|
|
21
|
+
version_hex = driver_version.value
|
|
22
|
+
major = (version_hex & 0xFF000000) >> 24
|
|
23
|
+
minor = (version_hex & 0x00FF0000) >> 16
|
|
24
|
+
build = version_hex & 0x0000FFFF
|
|
25
|
+
# Available starting from build 21797
|
|
26
|
+
if build < 21797:
|
|
27
|
+
version_str = "v{}.{}.{}".format(major, minor, build)
|
|
28
|
+
raise OSError(f"Driver version build {version_str} does not support writing spcm version to log")
|
|
29
|
+
from importlib.metadata import version
|
|
30
|
+
version_tag = version('spcm_core')
|
|
31
|
+
version_str = bytes("Python package spcm_core v{}".format(version_tag), "utf-8")
|
|
32
|
+
version_ptr = create_string_buffer(version_str)
|
|
33
|
+
dwErr = spcm_dwSetParam_ptr(None, SPC_WRITE_TO_LOG, version_ptr, len(version_str))
|
|
34
|
+
except OSError as e:
|
|
35
|
+
print(e)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
# This file was generated by 'versioneer.py' (0.29) from
|
|
3
|
+
# revision-control system data, or from the parent directory name of an
|
|
4
|
+
# unpacked source archive. Distribution tarballs contain a pre-generated copy
|
|
5
|
+
# of this file.
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
|
|
9
|
+
version_json = '''
|
|
10
|
+
{
|
|
11
|
+
"date": "2024-09-12T10:16:24+0200",
|
|
12
|
+
"dirty": false,
|
|
13
|
+
"error": null,
|
|
14
|
+
"full-revisionid": "2cd15702e6c2e8a2cf797be49f3e9d0d6ac39578",
|
|
15
|
+
"version": "0.0.3"
|
|
16
|
+
}
|
|
17
|
+
''' # END VERSION_JSON
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def get_versions():
|
|
21
|
+
return json.loads(version_json)
|