Skip to content

Commit

Permalink
TST: fix failing tests on self.shape
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Sep 24, 2023
1 parent e4515db commit 01d92a3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
2 changes: 2 additions & 0 deletions scripts/start_sirepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ cmd_start="${docker_binary} run ${arg} --init ${remove_container} --name sirepo
-p 8000:8000 \
-v $SIREPO_SRDB_HOST_RO:/SIREPO_SRDB_ROOT:ro,z "

# TODO: parametrize host port number.

cmd_extra=""
if [ ! -z "${SIREPO_SRDB_HOST}" -a ! -z "${SIREPO_SRDB_GUEST}" ]; then
cmd_extra="-v ${SIREPO_SRDB_HOST}:${SIREPO_SRDB_GUEST}:rw,z "
Expand Down
1 change: 0 additions & 1 deletion sirepo_bluesky/common/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def trigger(self, *args, **kwargs):

class SirepoWatchpointBase(DeviceWithJSONData):
image = Cpt(ExternalFileReference, kind="normal")
# shape = Cpt(Signal)
flux = Cpt(Signal, kind="hinted")
mean = Cpt(Signal, kind="normal")
x = Cpt(Signal, kind="normal")
Expand Down
1 change: 0 additions & 1 deletion sirepo_bluesky/shadow/shadow_ophyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def trigger(self, *args, **kwargs):
self._resource_document["resource_kwargs"]["histogram_bins"] = nbins

def update_components(_data):
# self.shape.put(_data["shape"])
self.flux.put(_data["flux"])
self.mean.put(_data["mean"])
self.x.put(_data["x"])
Expand Down
5 changes: 0 additions & 5 deletions sirepo_bluesky/srw/srw_ophyd.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ def describe(self):

res[self.image.name].update(dict(external="FILESTORE"))

for key in [self.shape.name]:
res[key].update(dict(dtype_str="<i8"))

for key in [self.vertical_extent.name, self.horizontal_extent.name]:
res[key].update(dict(dtype_str="<f8"))

Expand Down Expand Up @@ -106,7 +103,6 @@ def trigger(self, *args, **kwargs):
self._dataset[current_frame, :, :] = data

def update_components(_data):
# self.shape.put(_data["shape"])
self.flux.put(_data["flux"])
self.mean.put(_data["mean"])
self.x.put(_data["x"])
Expand Down Expand Up @@ -200,7 +196,6 @@ def trigger(self, *args, **kwargs):
self._resource_document["resource_kwargs"]["ndim"] = ndim

def update_components(_data):
# self.shape.put(_data["shape"])
self.flux.put(_data["flux"])
self.mean.put(_data["mean"])
self.x.put(_data["x"])
Expand Down
24 changes: 13 additions & 11 deletions sirepo_bluesky/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
from sirepo_bluesky.shadow.shadow_handler import ShadowFileHandler
from sirepo_bluesky.srw.srw_handler import SRWFileHandler, SRWHDF5FileHandler

DEFAULT_SIREPO_URL = "http://localhost:8000"


@pytest.fixture(scope="function")
def db():
Expand Down Expand Up @@ -68,76 +70,76 @@ def make_dirs():

@pytest.fixture(scope="function")
def srw_empty_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "emptysim")
return connection


@pytest.fixture(scope="function")
def srw_youngs_double_slit_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "00000000")
return connection


@pytest.fixture(scope="function")
def srw_basic_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "00000001")
return connection


@pytest.fixture(scope="function")
def srw_tes_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "00000002")
return connection


@pytest.fixture(scope="function")
def srw_ari_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "00000003")
return connection


@pytest.fixture(scope="function")
def srw_chx_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("srw", "HXV1JQ5c")
return connection


@pytest.fixture(scope="function")
def shadow_basic_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("shadow", "00000001")
return connection


@pytest.fixture(scope="function")
def shadow_tes_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("shadow", "00000002")
return connection


@pytest.fixture(scope="function")
def madx_resr_storage_ring_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("madx", "00000000")
return connection


@pytest.fixture(scope="function")
def madx_bl1_compton_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("madx", "00000001")
return connection


@pytest.fixture(scope="function")
def madx_bl2_triplet_tdc_simulation(make_dirs):
connection = SirepoClient("http://localhost:8000")
connection = SirepoClient(DEFAULT_SIREPO_URL)
data, _ = connection.auth("madx", "00000002")
return connection

0 comments on commit 01d92a3

Please sign in to comment.