Skip to content

Commit

Permalink
Updates conversion of data lists to numpy arrays.
Browse files Browse the repository at this point in the history
After data acquisition is complete, data is stored in a
list where each element of the list is a list of length
two. The first element is a float and the second element
is a numpy array. New versions of numpy prohibit
automatic conversion of this kind of list to a numpy array
without explicitly stating the data type of the array
as an 'object'. This change is necessary to use versions
of numpy > 1.23.
  • Loading branch information
gadamc committed Feb 10, 2023
1 parent 8d97cee commit c144c90
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "qt3utils"
version = "1.0.2.dev0"
version = "1.0.2.dev1"

description = "A package for performing experiments in the QT3 lab at UW."
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/qt3utils/experiments/cwodmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def run(self, N_cycles = 500000,
logger.error(f'in finally.close. {type(e)}: {e}')

self.rfsynth.rf_off(self.rfsynth_channel)
data = np.array(data)
data = np.array(data, dtype=object)
data = data[data[:,0].argsort()] #sorts the data by values in zeroth column... this is necessary if random_order = True
return data

Expand Down
2 changes: 1 addition & 1 deletion src/qt3utils/experiments/podmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def run(self, N_cycles = 500000,
except Exception as e:
logger.error(f'in finally.close. {type(e)}: {e}')
#rfsynth.rf_off(self.rfsynth_channel)
data = np.array(data)
data = np.array(data, dtype=object)
data = data[data[:,0].argsort()] #sorts the data by values in zeroth column... this is necessary if random_order = True

return data
3 changes: 1 addition & 2 deletions src/qt3utils/experiments/rabi.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ def run(self, N_cycles = 50000,
except Exception as e:
pass
#rfsynth.rf_off(self.rfsynth_channel)
data = np.array(data)
data = np.array(data, dtype=object)

return data

return data
3 changes: 1 addition & 2 deletions src/qt3utils/experiments/ramsey.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,7 @@ def run(self, N_cycles = 50000,
except Exception as e:
logger.error(f'in finally.close. {type(e)}: {e}')
#rfsynth.rf_off(self.rfsynth_channel)
data = np.array(data)
data = np.array(data, dtype=object)

return data

return data

0 comments on commit c144c90

Please sign in to comment.