Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Run with new strax (#198)
Browse files Browse the repository at this point in the history
* pinned tests are nice for reproducibility

* Update pytest.yml

* Update setup.py

* test running with latest strax(en)

* Update test_contexts.py

* Update test_contexts.py

* bloody work

* less cmt in test

* change config outside

Co-authored-by: Tianyu Zhu <tz2263@columbia.edu>
  • Loading branch information
JoranAngevaare and zhut19 authored Aug 27, 2021
1 parent c8972e9 commit fc85b95
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 39 deletions.
70 changes: 35 additions & 35 deletions extra_requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Test compatibility with these most often:
strax==0.16.1
straxen==0.19.3
# File for the requirements of straxen with the automated tests
blosc==1.10.4 # Strax dependency
boltons==21.0.0
datashader==0.13.0
dask==2021.8.1
dill==0.3.4 # Strax dependency
coveralls==3.2.0
commentjson==0.9.0
coverage==5.5
flake8==3.9.2
holoviews==1.14.5
ipywidgets==7.6.3
hypothesis==6.17.0
jupyter-client==7.0.1 # for ipywidgets
matplotlib==3.4.3
multihist==0.6.4
npshmex==0.2.1 # Strax dependency
numba==0.53.1 # Strax dependency
numpy==1.19.5
pandas==1.3.2 # Strax dependency
psutil==5.8.0 # Strax dependency
pytest==6.2.4
pytest-cov==2.12.1
scikit-learn==0.24.2
scipy==1.7.1 # Strax dependency
tensorflow==2.5.1
tqdm==4.62.2
xarray==0.19.0
utilix==0.6.1
zstd==1.5.0.2 # Strax dependency
uproot==4.0.11
# Test compatibility with these most often:
strax==1.0.0rc
straxen==1.0.0rc

# File for the requirements of straxen with the automated tests
blosc==1.10.4 # Strax dependency
boltons==21.0.0
datashader==0.13.0
dask==2021.8.1
dill==0.3.4 # Strax dependency
coveralls==3.2.0
commentjson==0.9.0
coverage==5.5
flake8==3.9.2
holoviews==1.14.5
ipywidgets==7.6.3
hypothesis==6.17.0
jupyter-client==7.0.1 # for ipywidgets
matplotlib==3.4.3
multihist==0.6.4
npshmex==0.2.1 # Strax dependency
numba==0.53.1 # Strax dependency
numpy==1.19.5
pandas==1.3.2 # Strax dependency
psutil==5.8.0 # Strax dependency
pytest==6.2.4
pytest-cov==2.12.1
scikit-learn==0.24.2
scipy==1.7.1 # Strax dependency
tensorflow==2.5.1
tqdm==4.62.2
xarray==0.19.0
utilix==0.6.1
zstd==1.5.0.2 # Strax dependency
uproot==4.0.11
5 changes: 5 additions & 0 deletions tests/test_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,9 @@ def remove_from_registry(context, endswith):
for p in list(context._plugin_class_registry.keys()):
if p.endswith(endswith):
del context._plugin_class_registry[p]
elif ('events_tagged' in context._plugin_class_registry[p].provides or
'peak_veto_tags' in context._plugin_class_registry[p].provides):
# These plugins are known to mix nv/mv/tpc
del context._plugin_class_registry[p]

return context
20 changes: 16 additions & 4 deletions tests/test_wfsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def test_sim_nT_advanced():

with tempfile.TemporaryDirectory() as tempdir:
log.debug(f'Working in {tempdir}')
st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000')
st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000', _config_overlap={},)
st.set_config(dict(gain_model_mc=("to_pe_placeholder", True),
gain_model=("to_pe_placeholder", True),
hit_min_amplitude='pmt_commissioning_initial'
))
st.set_config(dict(nchunk=1, event_rate=1, chunk_size=2,))

log.debug(f'Getting raw-records')
Expand All @@ -124,7 +128,11 @@ def test_sim_nT_advanced():

with tempfile.TemporaryDirectory() as tempdir:
log.debug(f'Working in {tempdir}')
st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000')
st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000', _config_overlap={},)
st.set_config(dict(gain_model_mc=("to_pe_placeholder", True),
gain_model=("to_pe_placeholder", True),
hit_min_amplitude='pmt_commissioning_initial'
))
st.set_config(dict(nchunk=1, event_rate=1, chunk_size=2,))

st.set_config({'fax_config_override': dict(s2_luminescence_model='simple',
Expand Down Expand Up @@ -155,8 +163,12 @@ def test_sim_mc_chain():
url_data = requests.get(test_g4).content
with open('test.root', mode='wb') as f:
f.write(url_data)

st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000')
st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='010000', _config_overlap={},)
st.set_config(dict(gain_model_mc=("to_pe_placeholder", True),
gain_model=("to_pe_placeholder", True),
gain_model_nv=("adc_nv", True),
hit_min_amplitude='pmt_commissioning_initial'
))

epix_config = {'cut_by_eventid': True, 'debug': True, 'source_rate': 0, 'micro_separation_time': 10.,
'max_delay': 1e7, 'detector_config_override': None, 'micro_separation': 0.05,
Expand Down

0 comments on commit fc85b95

Please sign in to comment.