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.
@@ -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.
@@ -0,0 +1,2 @@
1
+ include LICENSE
2
+ global-exclude *.dll
@@ -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
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
42
+ [![PyPI - Version](https://img.shields.io/pypi/v/spcm_core)](https://pypi.org/project/spcm_core)
43
+ [![PyPi Downloads](https://img.shields.io/pypi/dm/spcm_core?label=downloads%20%7C%20pip&logo=PyPI)](https://pypi.org/project/spcm_core)
44
+ [![Follow](https://img.shields.io/twitter/follow/SpecInstruments.svg?style=social&style=flat&logo=twitter&label=Follow&color=blue)](https://twitter.com/SpecInstruments/)
45
+ ![GitHub followers](https://img.shields.io/github/followers/SpectrumInstrumentation)
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
+ [![Static Badge](https://img.shields.io/badge/Python-3.9+-blue)](https://www.python.org/)
57
+ [![Static Badge](https://img.shields.io/badge/NumPy-1.25+-green)](https://numpy.org/)
58
+ [![Static Badge](https://img.shields.io/badge/h5py-3.10+-orange)](https://www.h5py.org/)
59
+ [![Static Badge](https://img.shields.io/badge/pint-0.23+-teal)](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
+ [![Pip Package](https://img.shields.io/pypi/v/spcm_core?logo=PyPI)](https://pypi.org/project/spcm_core)
66
+ [![Publish to PyPI](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-publish-to-pypi.yml/badge.svg)](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
+ [![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html)
80
+ [![Build dosc](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml/badge.svg)](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml)
81
+ [![Publish docs](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/pages/pages-build-deployment/badge.svg)](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
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![PyPI - Version](https://img.shields.io/pypi/v/spcm_core)](https://pypi.org/project/spcm_core)
10
+ [![PyPi Downloads](https://img.shields.io/pypi/dm/spcm_core?label=downloads%20%7C%20pip&logo=PyPI)](https://pypi.org/project/spcm_core)
11
+ [![Follow](https://img.shields.io/twitter/follow/SpecInstruments.svg?style=social&style=flat&logo=twitter&label=Follow&color=blue)](https://twitter.com/SpecInstruments/)
12
+ ![GitHub followers](https://img.shields.io/github/followers/SpectrumInstrumentation)
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
+ [![Static Badge](https://img.shields.io/badge/Python-3.9+-blue)](https://www.python.org/)
24
+ [![Static Badge](https://img.shields.io/badge/NumPy-1.25+-green)](https://numpy.org/)
25
+ [![Static Badge](https://img.shields.io/badge/h5py-3.10+-orange)](https://www.h5py.org/)
26
+ [![Static Badge](https://img.shields.io/badge/pint-0.23+-teal)](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
+ [![Pip Package](https://img.shields.io/pypi/v/spcm_core?logo=PyPI)](https://pypi.org/project/spcm_core)
33
+ [![Publish to PyPI](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-publish-to-pypi.yml/badge.svg)](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
+ [![Documentation](https://img.shields.io/badge/api-reference-blue.svg)](https://spectruminstrumentation.github.io/spcm_core/spcm_core.html)
47
+ [![Build dosc](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml/badge.svg)](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/spcm_core-docs-pages.yml)
48
+ [![Publish docs](https://github.com/SpectrumInstrumentation/spcm_core/actions/workflows/pages/pages-build-deployment/badge.svg)](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"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,12 @@
1
+ import os
2
+ import sys
3
+
4
+ import setuptools
5
+
6
+ if __name__ == "__main__":
7
+ sys.path.insert(0, os.path.dirname(__file__))
8
+
9
+ import versioneer
10
+
11
+ setuptools.setup(version=versioneer.get_version(),
12
+ cmdclass=versioneer.get_cmdclass())
@@ -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)
@@ -0,0 +1,6 @@
1
+ from .regs import *
2
+ from .spcerr import *
3
+
4
+ from .pyspcm import SPCM_DIR_PCTOCARD, SPCM_DIR_CARDTOPC, SPCM_DIR_CARDTOGPU, SPCM_DIR_GPUTOCARD,\
5
+ SPCM_BUF_DATA, SPCM_BUF_ABA, SPCM_BUF_TIMESTAMP, TYPE_INT64, TYPE_DOUBLE, _U, ST_LIST_PARAM, Direction
6
+