barsukov 1.3.3__py3-none-any.whl → 1.3.4__py3-none-any.whl
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.
Potentially problematic release.
This version of barsukov might be problematic. Click here for more details.
- barsukov/__init__.py +1 -4
- barsukov/app/lock_in_emulator_app.py +293 -0
- barsukov/data/Change_phase.py +160 -0
- barsukov/data/Lock_in_emulator.py +183 -0
- barsukov/data/__init__.py +4 -0
- barsukov/data/constants.py +10 -0
- barsukov/data/fft.py +100 -55
- barsukov/data/noise.py +276 -0
- barsukov/exp/__init__.py +2 -0
- barsukov/exp/mwHP.py +11 -2
- barsukov/exp/smKE.py +148 -0
- barsukov/logger.py +4 -3
- barsukov/script.py +16 -4
- barsukov/time.py +1 -1
- {barsukov-1.3.3.dist-info → barsukov-1.3.4.dist-info}/METADATA +6 -2
- barsukov-1.3.4.dist-info/RECORD +20 -0
- {barsukov-1.3.3.dist-info → barsukov-1.3.4.dist-info}/WHEEL +1 -1
- barsukov-1.3.3.dist-info/RECORD +0 -14
- {barsukov-1.3.3.dist-info → barsukov-1.3.4.dist-info}/top_level.txt +0 -0
barsukov/logger.py
CHANGED
|
@@ -73,7 +73,7 @@ class Logger:
|
|
|
73
73
|
full_folder_path = self.full_folder_path
|
|
74
74
|
|
|
75
75
|
### Create a file name like log_timeStamp_description_.txt ###
|
|
76
|
-
if
|
|
76
|
+
if description is not None and description != '':
|
|
77
77
|
description = f"_{description}"
|
|
78
78
|
else:
|
|
79
79
|
description = ''
|
|
@@ -104,10 +104,11 @@ class Logger:
|
|
|
104
104
|
|
|
105
105
|
def write_to_file(self, msg):
|
|
106
106
|
if self.file:
|
|
107
|
+
#add lock here
|
|
107
108
|
self.file.write(msg)
|
|
108
109
|
### flushing the log file to make sure it's written ###
|
|
109
110
|
self.file.flush()
|
|
110
|
-
os.fsync(self.file)
|
|
111
|
+
#os.fsync(self.file) ##.fileno()
|
|
111
112
|
else:
|
|
112
113
|
self.file_error = True
|
|
113
114
|
print(f'{time_stamp()} Logger is trying to write to a closed or non-existent file.')
|
|
@@ -119,7 +120,7 @@ class Logger:
|
|
|
119
120
|
log = 'screen'
|
|
120
121
|
elif log == 'important' and self.log_mode == 'file':
|
|
121
122
|
log = 'both'
|
|
122
|
-
elif (log == 'important') or(log == 'default') or (log is None):
|
|
123
|
+
elif (log == 'important') or (log == 'default') or (log is None):
|
|
123
124
|
log = self.log_mode
|
|
124
125
|
|
|
125
126
|
decorated_message = self.decorated_msg(msg)
|
barsukov/script.py
CHANGED
|
@@ -64,11 +64,10 @@ class Script():
|
|
|
64
64
|
os.makedirs(self.full_folder_path, exist_ok=True)
|
|
65
65
|
|
|
66
66
|
### Logger Attributes
|
|
67
|
-
self.start_logger = True
|
|
68
67
|
self.log_mode = log
|
|
69
68
|
self.log_full_folder_path = log_full_folder_path
|
|
70
69
|
self.log_full_file_path = log_full_file_path
|
|
71
|
-
self.init_logger(start=
|
|
70
|
+
self.init_logger(start=True)
|
|
72
71
|
self.logger_name = self.logger.full_file_path
|
|
73
72
|
|
|
74
73
|
### Equipment Attributes
|
|
@@ -130,6 +129,20 @@ class Script():
|
|
|
130
129
|
"""
|
|
131
130
|
from barsukov.exp.mwHP import mwHP as eq
|
|
132
131
|
return eq(gpib, logger=self.logger, script=self, **kwargs)
|
|
132
|
+
|
|
133
|
+
def smKE(self, gpib=None, **kwargs):
|
|
134
|
+
"""
|
|
135
|
+
Initializes and returns a mwHP equipment object with the specified parameters.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
gpib (str): gpib number of equipment. Defaults to 'None'.
|
|
139
|
+
**kwargs: Additional keyword arguments passed to the mwHP equipment initialization.
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
mwHP: A mwHP equipment object.
|
|
143
|
+
"""
|
|
144
|
+
from barsukov.exp.smKE import smKE as eq
|
|
145
|
+
return eq(gpib, logger=self.logger, script=self, **kwargs)
|
|
133
146
|
### END: Equipment devices
|
|
134
147
|
|
|
135
148
|
|
|
@@ -138,7 +151,6 @@ class Script():
|
|
|
138
151
|
# Prepares the Script object for serialization by removing non-seriable attributes (e.g. logger and rm).
|
|
139
152
|
# Returns a dict: A dictionary representing the serializable state of the Script object.
|
|
140
153
|
seriable_data = self.__dict__.copy()
|
|
141
|
-
seriable_data['start_log'] = False
|
|
142
154
|
del seriable_data['logger']
|
|
143
155
|
del seriable_data['rm']
|
|
144
156
|
return seriable_data
|
|
@@ -148,6 +160,6 @@ class Script():
|
|
|
148
160
|
# Restores the Script object from its serialized state, including reinitializing the logger and rm.
|
|
149
161
|
# Args: seriable_data (dict): A dictionary representing the serialized state of the Script object
|
|
150
162
|
self.__dict__.update(seriable_data)
|
|
151
|
-
self.init_logger(
|
|
163
|
+
self.init_logger(start=False)
|
|
152
164
|
if self.equipment is True: self.init_rm()
|
|
153
165
|
### END: OBJ2FILE TOOLS:
|
barsukov/time.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: barsukov
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: Experiment Automation Package
|
|
5
5
|
Author-email: Igor Barsukov <igorb@ucr.edu>, Steven Castaneda <scast206@ucr.edu>
|
|
6
6
|
Project-URL: Homepage, https://barsukov.ucr.edu
|
|
@@ -16,6 +16,10 @@ Requires-Dist: scipy>=0.9.0
|
|
|
16
16
|
|
|
17
17
|
Barsukov is a Python library for experiment automation.
|
|
18
18
|
|
|
19
|
+
## For Developers
|
|
20
|
+
|
|
21
|
+
To push to PyPi, commit to main on Github Desktop, click the history tab, right click and create tag, format the tag v\*.\*.\* and push to the repository (ctrl+p).
|
|
22
|
+
|
|
19
23
|
## Installation
|
|
20
24
|
|
|
21
25
|
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install barsukov.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
barsukov/__init__.py,sha256=7frhJ1d67SdEKCZKmi4Zr-2QnQzFA-YK2Pki4IQYKEw,202
|
|
2
|
+
barsukov/logger.py,sha256=BBqeid3kX7RJLKmHS4E1jH3KmlIrU3vaR4udSkk4gd4,6529
|
|
3
|
+
barsukov/obj2file.py,sha256=nivCmCEpmOSaG4VpQgIDb-7hsvdEq45Iuu5HOfRxbcw,3923
|
|
4
|
+
barsukov/script.py,sha256=JdTL-w-4FLh5k6T1IHnxX3zT4CQzDUfAs6usHHMUE30,6775
|
|
5
|
+
barsukov/time.py,sha256=apjdgwCXDNBAMyVfsAvfcORz4BkU2--d1BDLHIl_ar4,1038
|
|
6
|
+
barsukov/app/lock_in_emulator_app.py,sha256=47TSN80a7Z8A1sSKEaWBtAS-ECsoa6Nig8bJDQ9B9-E,11483
|
|
7
|
+
barsukov/data/Change_phase.py,sha256=jOCjO4vvk39PEWhOTnLwaPZd769gCDz71nfKwIgSz6I,6998
|
|
8
|
+
barsukov/data/Lock_in_emulator.py,sha256=FvySLcpf19d0sW1EGEisNGzBsN2Wq4N1CoqHvtJRtkI,7509
|
|
9
|
+
barsukov/data/__init__.py,sha256=VkLvw8f14P1bTTgTEzICzRzbmdGtRDE3U7MwegAn2Ak,148
|
|
10
|
+
barsukov/data/constants.py,sha256=SsnqLCjD1M_To7vpr2yXLE4djw4Yc7302t8cKhPWLgQ,156
|
|
11
|
+
barsukov/data/fft.py,sha256=C-PRVySyMYmSJva_S8OwjJBB26pp45ttndjgcaYXZkE,5655
|
|
12
|
+
barsukov/data/noise.py,sha256=MsLifk1Uyq6mjMcYq8ovuskOTRwsrZNqYRRs37IONOc,10504
|
|
13
|
+
barsukov/exp/__init__.py,sha256=DBzvcR0flW6ouWFdmOxngPzyFx_6t5ECztspJ8uX89M,39
|
|
14
|
+
barsukov/exp/exp_utils.py,sha256=7qVQJbJGbsNW0JZQ7A1cmI73J6vi_aN8Zu6WMq2-7LE,4789
|
|
15
|
+
barsukov/exp/mwHP.py,sha256=KAaQPeNI67_xxx-6JesfViHRkWPUqkufdrkwoVZzBnY,12591
|
|
16
|
+
barsukov/exp/smKE.py,sha256=EAhl1WjNv5dP_eZDPfQ-4qdtH8KOvLhNLM666VIvLuM,6107
|
|
17
|
+
barsukov-1.3.4.dist-info/METADATA,sha256=CcTkRswvBIp-oc7owcxsLnWal_D1J39rJ81XxKO8fC0,975
|
|
18
|
+
barsukov-1.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
barsukov-1.3.4.dist-info/top_level.txt,sha256=Js5sHbNjP0UNMB9O5HtCHZqlfHabuNS8nTsHbg-1DDQ,9
|
|
20
|
+
barsukov-1.3.4.dist-info/RECORD,,
|
barsukov-1.3.3.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
barsukov/__init__.py,sha256=GVsEnM_uD4x1XN_PIKdD-VSRMNUnvPr2iCWuEHwM6sU,293
|
|
2
|
-
barsukov/logger.py,sha256=nrkS1Pg3WGEjRJQ5MbplhyGYGbfFGkgyxgx1qdSu1x0,6489
|
|
3
|
-
barsukov/obj2file.py,sha256=nivCmCEpmOSaG4VpQgIDb-7hsvdEq45Iuu5HOfRxbcw,3923
|
|
4
|
-
barsukov/script.py,sha256=nrKwEl60u9ces3B8FwRfY4VmlEx5bNvk_hoPaylldP0,6359
|
|
5
|
-
barsukov/time.py,sha256=fSf5JKqr6Pd5691qQcFuBsjDd9alMrfASnndlstLits,1039
|
|
6
|
-
barsukov/data/__init__.py,sha256=IMnOEliXsRMPWeCTprPSddRKg9kwfV-neQiwUwHdpqs,19
|
|
7
|
-
barsukov/data/fft.py,sha256=f9aPLeusVpWiWmXO5n4XwkfQ9xJQhZVFdyhFoT9DB2A,4365
|
|
8
|
-
barsukov/exp/__init__.py,sha256=urLfGpap40kN9ULi53JB0NT-iMsZDSFdBmdSq3ckB0E,19
|
|
9
|
-
barsukov/exp/exp_utils.py,sha256=7qVQJbJGbsNW0JZQ7A1cmI73J6vi_aN8Zu6WMq2-7LE,4789
|
|
10
|
-
barsukov/exp/mwHP.py,sha256=eoX82jon5nIsExvRHO1PIOQAWWWhJYY4N21VtoLXuSw,12136
|
|
11
|
-
barsukov-1.3.3.dist-info/METADATA,sha256=W5yH8yp2NKZgWqTi2TLUFW3xYSo7lzfy7IS7bNj7Y4k,791
|
|
12
|
-
barsukov-1.3.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
13
|
-
barsukov-1.3.3.dist-info/top_level.txt,sha256=Js5sHbNjP0UNMB9O5HtCHZqlfHabuNS8nTsHbg-1DDQ,9
|
|
14
|
-
barsukov-1.3.3.dist-info/RECORD,,
|
|
File without changes
|