pymodaq_utils 0.0.2__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,129 @@
1
+ # Compiled python modules.
2
+ *.pyc
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+
7
+
8
+ *.py[cod]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+ .idea/*
14
+
15
+ # Distribution / packaging
16
+ .Python
17
+ documentation/_*
18
+ build/
19
+ develop-eggs/
20
+ dist/
21
+ downloads/
22
+ eggs/
23
+ .eggs/
24
+ lib/
25
+ lib64/
26
+ parts/
27
+ sdist/
28
+ var/
29
+ wheels/
30
+ *.egg-info/
31
+ .installed.cfg
32
+ *.egg
33
+ MANIFEST
34
+
35
+ # PyInstaller
36
+ # Usually these files are written by a python script from a template
37
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
38
+ *.manifest
39
+ *.spec
40
+
41
+ # Installer logs
42
+ pip-log.txt
43
+ pip-delete-this-directory.txt
44
+
45
+ # Unit test / coverage reports
46
+ htmlcov/
47
+ .tox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+
57
+ *.idea
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+
64
+ # Django stuff:
65
+ *.log
66
+ local_settings.py
67
+ db.sqlite3
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # pyenv
86
+ .python-version
87
+
88
+ # celery beat schedule file
89
+ celerybeat-schedule
90
+
91
+ # SageMath parsed files
92
+ *.sage.py
93
+
94
+ # Environments
95
+ .env
96
+ .venv
97
+ env/
98
+ venv/
99
+ ENV/
100
+ env.bak/
101
+ venv.bak/
102
+
103
+ # Spyder project settings
104
+ .spyderproject
105
+ .spyproject
106
+
107
+ # VS code project settings
108
+ .vscode/*
109
+
110
+ # Rope project settings
111
+ .ropeproject
112
+
113
+ # mkdocs documentation
114
+ /site
115
+
116
+ # mypy
117
+ .mypy_cache/
118
+ .idea/workspace.xml
119
+
120
+ *.iml
121
+
122
+
123
+ .tox
124
+ *.h5
125
+ !data.h5
126
+
127
+ *yacctab.py
128
+ *lextab.py
129
+
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Sebastien Weber <sebastien.weber@cemes.fr>
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,152 @@
1
+ Metadata-Version: 2.3
2
+ Name: pymodaq_utils
3
+ Version: 0.0.2
4
+ Summary: Modular Data Acquisition with Python
5
+ Project-URL: Homepage, http://pymodaq.cnrs.fr
6
+ Project-URL: Source, https://github.com/PyMoDAQ/PyMoDAQ
7
+ Project-URL: Tracker, https://github.com/PyMoDAQ/PyMoDAQ/issues
8
+ Author-email: Sébastien Weber <sebastien.weber@cemes.fr>
9
+ License: The MIT License (MIT)
10
+
11
+ Copyright (c) 2021 Sebastien Weber <sebastien.weber@cemes.fr>
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in
21
+ all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
+ THE SOFTWARE.
30
+ License-File: LICENSE
31
+ Classifier: Development Status :: 5 - Production/Stable
32
+ Classifier: Environment :: Other Environment
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Natural Language :: English
36
+ Classifier: Operating System :: OS Independent
37
+ Classifier: Programming Language :: Python :: 3.7
38
+ Classifier: Programming Language :: Python :: 3.8
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Topic :: Scientific/Engineering :: Human Machine Interfaces
43
+ Classifier: Topic :: Scientific/Engineering :: Visualization
44
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
45
+ Classifier: Topic :: Software Development :: User Interfaces
46
+ Requires-Python: >=3.7
47
+ Requires-Dist: multipledispatch
48
+ Requires-Dist: numpy<2.0.0
49
+ Requires-Dist: packaging
50
+ Requires-Dist: pint
51
+ Requires-Dist: python-dateutil
52
+ Requires-Dist: scipy
53
+ Requires-Dist: setuptools>=60
54
+ Requires-Dist: toml
55
+ Description-Content-Type: text/x-rst
56
+
57
+ PyMoDAQ
58
+ #######
59
+
60
+ .. image:: https://img.shields.io/pypi/v/pymodaq.svg
61
+ :target: https://pypi.org/project/pymodaq/
62
+ :alt: Latest Version
63
+
64
+ .. image:: https://readthedocs.org/projects/pymodaq/badge/?version=latest
65
+ :target: https://pymodaq.readthedocs.io/en/stable/?badge=latest
66
+ :alt: Documentation Status
67
+
68
+ .. image:: https://codecov.io/gh/PyMoDAQ/PyMoDAQ/branch/pymodaq-dev/graph/badge.svg?token=IQNJRCQDM2
69
+ :target: https://codecov.io/gh/PyMoDAQ/PyMoDAQ
70
+
71
+ ====== ========== ======= ======
72
+ Python Qt Backend OS Passed
73
+ ====== ========== ======= ======
74
+ 3.8 Qt5 Linux |38Qt5|
75
+ 3.9 Qt5 Linux |39Qt5|
76
+ 3.10 Qt5 Linux |310Qt5|
77
+ 3.11 Qt5 Linux |311Qt5|
78
+ 3.8 Qt5 Windows |38Qt5win|
79
+ 3.8 PySide2 Linux |38pyside|
80
+ 3.9 Qt6 Linux |39Qt6|
81
+ ====== ========== ======= ======
82
+
83
+
84
+ .. |38Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5.yml/badge.svg?branch=pymodaq-dev
85
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5.yml
86
+
87
+ .. |39Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt5.yml/badge.svg?branch=pymodaq-dev
88
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt5.yml
89
+
90
+ .. |310Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp310pyqt5.yml/badge.svg?branch=pymodaq-dev
91
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp310pyqt5.yml
92
+
93
+ .. |311Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp311pyqt5.yml/badge.svg?branch=pymodaq-dev
94
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp311pyqt5.yml
95
+
96
+ .. |38Qt5win| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5_win.yml/badge.svg?branch=pymodaq-dev
97
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5_win.yml
98
+
99
+ .. |38pyside| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyside2.yml/badge.svg?branch=pymodaq-dev
100
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyside2.yml
101
+
102
+ .. |39Qt6| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt6.yml/badge.svg?branch=pymodaq-dev
103
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt6.yml
104
+
105
+
106
+
107
+ .. figure:: http://pymodaq.cnrs.fr/en/latest/_static/splash.png
108
+ :alt: shortcut
109
+
110
+
111
+ PyMoDAQ, Modular Data Acquisition with Python, is a set of **python** modules used to interface any kind of experiments.
112
+ It simplifies the interaction with detector and actuator hardware to go straight to the data acquisition of interest.
113
+
114
+ It has two purposes:
115
+
116
+ * First, to provide a complete interface to perform automated measurements or logging data without having to write a user/interface for each
117
+ new experiment, this is under the *Dashboard_module* environment and its extensions.
118
+ * Second, to provide various tools (modules) to easily build *custom apps*
119
+
120
+ It is organised a shown below:
121
+
122
+ .. figure:: http://pymodaq.cnrs.fr/en/latest/_images/pymodaq_diagram.png
123
+ :alt: overview
124
+
125
+ PyMoDAQ's Dashboard and its extensions: DAQ_Scan for automated acquisitions, DAQ_Logger for data logging and many other.
126
+
127
+ The main component is the **Dashboard** : This is a graphical component that will initialize actuators and detectors given
128
+ the need of your particular experiment. You configure the dashboard using an interface for quick launch of various
129
+ configurations (numbers and types of control modules).
130
+
131
+ The detectors and the actuators are represented and manipulated using two control modules:
132
+
133
+ * **DAQ_Move_module** : used to control/drive an actuator (stand alone and/or automated).
134
+ Any number of these modules can be instantiated in the Dashboard
135
+ * **DAQ_Viewer_module** : used to control/drive a detector (stand alone and/or automated).
136
+
137
+ Any number of these modules can be instantiated in the Dashboard.
138
+
139
+ The Dashboard allows you to start dedicated extensions that will make use of the control modules:
140
+
141
+ * **DAQ_Logger_module** : This module lets you log data from one or many detectors defined in the dashboard. You can log data
142
+ in a binary hierarchical hdf5 file or towards a sql database
143
+ * **DAQ_Scan_module** : This module lets you configure automated data acquisition from one or many detectors defined
144
+ in the dashboard as a function or one or more actuators defined also in the dashboard.
145
+
146
+ and many others to simplify any application development.
147
+
148
+ Published under the MIT FREE SOFTWARE LICENSE
149
+
150
+ GitHub repo: https://github.com/PyMoDAQ
151
+
152
+ Documentation: http://pymodaq.cnrs.fr/
@@ -0,0 +1,96 @@
1
+ PyMoDAQ
2
+ #######
3
+
4
+ .. image:: https://img.shields.io/pypi/v/pymodaq.svg
5
+ :target: https://pypi.org/project/pymodaq/
6
+ :alt: Latest Version
7
+
8
+ .. image:: https://readthedocs.org/projects/pymodaq/badge/?version=latest
9
+ :target: https://pymodaq.readthedocs.io/en/stable/?badge=latest
10
+ :alt: Documentation Status
11
+
12
+ .. image:: https://codecov.io/gh/PyMoDAQ/PyMoDAQ/branch/pymodaq-dev/graph/badge.svg?token=IQNJRCQDM2
13
+ :target: https://codecov.io/gh/PyMoDAQ/PyMoDAQ
14
+
15
+ ====== ========== ======= ======
16
+ Python Qt Backend OS Passed
17
+ ====== ========== ======= ======
18
+ 3.8 Qt5 Linux |38Qt5|
19
+ 3.9 Qt5 Linux |39Qt5|
20
+ 3.10 Qt5 Linux |310Qt5|
21
+ 3.11 Qt5 Linux |311Qt5|
22
+ 3.8 Qt5 Windows |38Qt5win|
23
+ 3.8 PySide2 Linux |38pyside|
24
+ 3.9 Qt6 Linux |39Qt6|
25
+ ====== ========== ======= ======
26
+
27
+
28
+ .. |38Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5.yml/badge.svg?branch=pymodaq-dev
29
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5.yml
30
+
31
+ .. |39Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt5.yml/badge.svg?branch=pymodaq-dev
32
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt5.yml
33
+
34
+ .. |310Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp310pyqt5.yml/badge.svg?branch=pymodaq-dev
35
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp310pyqt5.yml
36
+
37
+ .. |311Qt5| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp311pyqt5.yml/badge.svg?branch=pymodaq-dev
38
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp311pyqt5.yml
39
+
40
+ .. |38Qt5win| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5_win.yml/badge.svg?branch=pymodaq-dev
41
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyqt5_win.yml
42
+
43
+ .. |38pyside| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyside2.yml/badge.svg?branch=pymodaq-dev
44
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp38pyside2.yml
45
+
46
+ .. |39Qt6| image:: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt6.yml/badge.svg?branch=pymodaq-dev
47
+ :target: https://github.com/PyMoDAQ/PyMoDAQ/actions/workflows/Testp39pyqt6.yml
48
+
49
+
50
+
51
+ .. figure:: http://pymodaq.cnrs.fr/en/latest/_static/splash.png
52
+ :alt: shortcut
53
+
54
+
55
+ PyMoDAQ, Modular Data Acquisition with Python, is a set of **python** modules used to interface any kind of experiments.
56
+ It simplifies the interaction with detector and actuator hardware to go straight to the data acquisition of interest.
57
+
58
+ It has two purposes:
59
+
60
+ * First, to provide a complete interface to perform automated measurements or logging data without having to write a user/interface for each
61
+ new experiment, this is under the *Dashboard_module* environment and its extensions.
62
+ * Second, to provide various tools (modules) to easily build *custom apps*
63
+
64
+ It is organised a shown below:
65
+
66
+ .. figure:: http://pymodaq.cnrs.fr/en/latest/_images/pymodaq_diagram.png
67
+ :alt: overview
68
+
69
+ PyMoDAQ's Dashboard and its extensions: DAQ_Scan for automated acquisitions, DAQ_Logger for data logging and many other.
70
+
71
+ The main component is the **Dashboard** : This is a graphical component that will initialize actuators and detectors given
72
+ the need of your particular experiment. You configure the dashboard using an interface for quick launch of various
73
+ configurations (numbers and types of control modules).
74
+
75
+ The detectors and the actuators are represented and manipulated using two control modules:
76
+
77
+ * **DAQ_Move_module** : used to control/drive an actuator (stand alone and/or automated).
78
+ Any number of these modules can be instantiated in the Dashboard
79
+ * **DAQ_Viewer_module** : used to control/drive a detector (stand alone and/or automated).
80
+
81
+ Any number of these modules can be instantiated in the Dashboard.
82
+
83
+ The Dashboard allows you to start dedicated extensions that will make use of the control modules:
84
+
85
+ * **DAQ_Logger_module** : This module lets you log data from one or many detectors defined in the dashboard. You can log data
86
+ in a binary hierarchical hdf5 file or towards a sql database
87
+ * **DAQ_Scan_module** : This module lets you configure automated data acquisition from one or many detectors defined
88
+ in the dashboard as a function or one or more actuators defined also in the dashboard.
89
+
90
+ and many others to simplify any application development.
91
+
92
+ Published under the MIT FREE SOFTWARE LICENSE
93
+
94
+ GitHub repo: https://github.com/PyMoDAQ
95
+
96
+ Documentation: http://pymodaq.cnrs.fr/
@@ -0,0 +1,58 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.9.0", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "pymodaq_utils"
7
+ dynamic = [
8
+ "version",
9
+ ]
10
+ description = "Modular Data Acquisition with Python"
11
+ readme = "README.rst"
12
+ license = { file="LICENSE" }
13
+ requires-python = ">=3.7"
14
+ authors = [
15
+ { name = "Sébastien Weber", email = "sebastien.weber@cemes.fr" },
16
+ ]
17
+ classifiers = [
18
+ "Development Status :: 5 - Production/Stable",
19
+ "Environment :: Other Environment",
20
+ "Intended Audience :: Science/Research",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Natural Language :: English",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3.7",
25
+ "Programming Language :: Python :: 3.8",
26
+ "Programming Language :: Python :: 3.9",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Topic :: Scientific/Engineering :: Human Machine Interfaces",
30
+ "Topic :: Scientific/Engineering :: Visualization",
31
+ "Topic :: Software Development :: Libraries :: Python Modules",
32
+ "Topic :: Software Development :: User Interfaces",
33
+ ]
34
+ dependencies = [
35
+ "multipledispatch",
36
+ "numpy < 2.0.0",
37
+ "packaging",
38
+ "pint",
39
+ "python-dateutil",
40
+ "scipy",
41
+ "setuptools>=60",
42
+ "toml",
43
+ ]
44
+
45
+ [project.scripts]
46
+
47
+ [project.urls]
48
+ Homepage = "http://pymodaq.cnrs.fr"
49
+ Source = "https://github.com/PyMoDAQ/PyMoDAQ"
50
+ Tracker = "https://github.com/PyMoDAQ/PyMoDAQ/issues"
51
+
52
+ [tool.hatch.version]
53
+ source = "vcs"
54
+
55
+ [tool.hatch.build.targets.sdist]
56
+ include = [
57
+ "/src",
58
+ ]
@@ -0,0 +1,35 @@
1
+ import importlib.util
2
+ import os
3
+ import sys
4
+ from pathlib import Path
5
+
6
+ import warnings
7
+
8
+ try:
9
+ # with open(str(Path(__file__).parent.joinpath('resources/VERSION')), 'r') as fvers:
10
+ # __version__ = fvers.read().strip()
11
+
12
+ from pymodaq_utils.logger import set_logger
13
+ from pymodaq_utils.utils import get_version, PackageNotFoundError
14
+ try:
15
+ __version__ = get_version('pymodaq_utils')
16
+ except PackageNotFoundError:
17
+ __version__ = '0.0.0dev'
18
+ try:
19
+ LOGGER = set_logger('pymodaq', add_handler=True, base_logger=True)
20
+ except Exception:
21
+ print("Couldn't create the local folder to store logs , presets...")
22
+
23
+ LOGGER.info('')
24
+ LOGGER.info('')
25
+
26
+ from pymodaq_utils.config import Config
27
+
28
+ CONFIG = Config() # to ckeck for config file existence, otherwise create one
29
+
30
+
31
+ except Exception as e:
32
+ try:
33
+ LOGGER.exception(str(e))
34
+ except Exception as e:
35
+ print(str(e))
@@ -0,0 +1,48 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ Created the 21/11/2022
4
+
5
+ @author: Sebastien Weber
6
+
7
+ Introduce some nice ABCMeta class allowing that a particular attribute has been declared when instantiating
8
+ See https://stackoverflow.com/a/50381071/8090831
9
+ """
10
+
11
+ from abc import ABCMeta as NativeABCMeta
12
+ from abc import abstractmethod
13
+ from typing import cast, Any, Callable, TypeVar
14
+
15
+
16
+ R = TypeVar('R')
17
+
18
+
19
+ class DummyAttribute:
20
+ pass
21
+
22
+
23
+ def abstract_attribute(obj: Callable[[Any], R] = None) -> R:
24
+ _obj = cast(Any, obj)
25
+ if obj is None:
26
+ _obj = DummyAttribute()
27
+ _obj.__is_abstract_attribute__ = True
28
+ return cast(R, _obj)
29
+
30
+
31
+ class ABCMeta(NativeABCMeta):
32
+
33
+ def __call__(cls, *args, **kwargs):
34
+ instance = NativeABCMeta.__call__(cls, *args, **kwargs)
35
+ abstract_attributes = {
36
+ name
37
+ for name in dir(instance)
38
+ if getattr(getattr(instance, name), '__is_abstract_attribute__', False)
39
+ }
40
+ if abstract_attributes:
41
+ raise NotImplementedError(
42
+ "Can't instantiate abstract class {} with"
43
+ " abstract attributes: {}".format(
44
+ cls.__name__,
45
+ ', '.join(abstract_attributes)
46
+ )
47
+ )
48
+ return instance