Skip to content

Commit

Permalink
Merge pull request #508 from BBN-Q/fix/sqlalchemy
Browse files Browse the repository at this point in the history
Fix/sqlalchemy
  • Loading branch information
ranzani authored Dec 4, 2024
2 parents cd8ac83 + f1811b7 commit bbef679
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/actions-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Python Package using Conda

on: [push]


jobs:
build-linux:
runs-on: ubuntu-latest
Expand All @@ -23,7 +24,7 @@ jobs:
echo $GITHUB_PATH
- name: pip cache
uses: actions/cache@v2
uses: actions/cache@v4
id: cache
with:
path: /usr/share/miniconda/lib/python3.8/site-packages/*
Expand All @@ -47,11 +48,12 @@ jobs:
- name: Install BBN dependencies
run: |
sudo apt-get install pandoc
export GIT_LFS_SKIP_SMUDGE=1
pip install git+https://github.com/BBN-Q/bbndb.git
pip install git+https://github.com/BBN-Q/QGL.git@develop
pip install git+https://github.com/spatialaudio/nbsphinx.git@master
pip install pyvisa coveralls scikit-learn pyusb future python-usbtmc setproctitle progress serial
pip install pyvisa coveralls scikit-learn pyusb future python-usbtmc setproctitle progress serial pandoc
export GIT_LFS_SKIP_SMUDGE=0
- name: Test with unittest
Expand Down
4 changes: 2 additions & 2 deletions src/auspex/data_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def new_dataset(self, groupname, datasetname, descriptor):
descriptor: `DataStreamDescriptor` that describes the dataset that is to be added.
"""
self._create_meta(groupname, datasetname, descriptor)
mmap = self._create_memmap(groupname, datasetname, (np.product(descriptor.dims()),), descriptor.dtype)
mmap = self._create_memmap(groupname, datasetname, (np.prod(descriptor.dims()),), descriptor.dtype)
self.groups[groupname][datasetname] = mmap
return mmap

Expand Down Expand Up @@ -158,7 +158,7 @@ def open_dataset(self, groupname, datasetname):

filename = os.path.join(self.base_path,groupname,datasetname+'.dat')
assert os.path.exists(filename), "Could not find dataset. Is this the correct name?"
flat_shape = (np.product(meta['shape']),)
flat_shape = (np.prod(meta['shape']),)
mm = np.memmap(filename, dtype=meta['dtype'], mode='r', shape=flat_shape)
data = np.array(mm).reshape(tuple(meta['shape']))
del mm
Expand Down
7 changes: 6 additions & 1 deletion src/auspex/qubit/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from functools import reduce
from IPython.display import HTML, display
from sqlalchemy import inspect
from sqlalchemy.orm import aliased

import auspex.config as config
import auspex.instruments
Expand Down Expand Up @@ -79,7 +80,11 @@ def __init__(self, force_new=False):
def add_qubit_pipeline(self, qubit_label, stream_type, auto_create=True, buffers=False):
# if qubit_label not in self.stream_selectors:
m = bbndb.qgl.Measurement
mqs = [l[0] for l in self.session.query(m.label).join(m.channel_db, aliased=True).filter_by(label="working").all()]
#n1 = aliased(m.label)

#mqs = [l[0] for l in self.session.query(m.label).join(m.channel_db.of_type(n1)).filter_by(n1.name == "working").all()]
mqs = [l[0] for l in self.session.query(m.label).join(m.channel_db).filter_by(label="working").all()]
#mqs = [l[0] for l in self.session.query(m.label).join(m.channel_db, aliased=True).filter_by(label="working").all()]
if f'M-{qubit_label}' not in mqs:
raise Exception(f"Could not find qubit {qubit_label} in pipeline...")

Expand Down
6 changes: 6 additions & 0 deletions src/auspex/qubit/qubit_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ def add_qubit_sweep(self, qubit, measure_or_control, attribute, values):
exp = QubitExpFactory.create(PulsedSpec(q1))
self.add_qubit_sweep(q1, "measure", "frequency", np.linspace(6e9, 6.5e9, 500))
self.run_sweeps()
Parameters:
qubit the qubit to sweep
measure_or_control measure or control channel
attribute the attribute to sweep
values the values to sweep through
"""
param = FloatParameter() # Create the parameter
param.name = f"{qubit.label} {measure_or_control} {attribute}"
Expand Down

0 comments on commit bbef679

Please sign in to comment.