Skip to content

Commit

Permalink
Merge pull request #315 from dmgav/use-tiled
Browse files Browse the repository at this point in the history
Support for Tiled at SRX beamline
  • Loading branch information
dmgav authored Apr 8, 2024
2 parents f1c4386 + 59a1a8c commit eb44f27
Show file tree
Hide file tree
Showing 7 changed files with 577 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ exclude =
pyxrf/_version.py,
docs/conf.py
# There are some errors produced by 'black', therefore unavoidable
ignore = E203, W503
ignore = E203, W503, E701, E704
max-line-length = 115
5 changes: 3 additions & 2 deletions pyxrf/core/map_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,9 @@ def snip_method_numba(
else:
iter_num = _default_iter_num_bin

# np.array(spectrum) is not supported by numba so we have to us this:
background = np.asarray(spectrum).copy()
# np.array(spectrum) is not supported by numba so we have to use this:
# background = np.asarray(spectrum).copy() # Also a problem (since Jan. 2024)
background = spectrum.copy()
n_background = background.size

energy = np.arange(n_background, dtype=np.float64)
Expand Down
2 changes: 1 addition & 1 deletion pyxrf/core/tests/test_quant_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"name": "Test Micromatter 411640",
"serial": "411640",
"description": "CeF3 21.1 / Au 20.6",
"compounds": {"CeF3": 21.1, "Au": 20.6}
"compounds": {"CeF3": 21.1, "Au": 20.6},
# Missing optional 'density' field
},
]
Expand Down
3 changes: 1 addition & 2 deletions pyxrf/gui_module/wnd_detailed_fitting_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,7 @@ def _validate_all(self):
self.pb_cancel.setEnabled(self._data_changed and not self._auto_update)
self.cb_auto_update.setChecked(Qt.Checked if self._auto_update else Qt.Unchecked)

def _load_dialog_data(self):
...
def _load_dialog_data(self): ...

def _save_dialog_data_function(self):
raise NotImplementedError()
Expand Down
27 changes: 27 additions & 0 deletions pyxrf/model/catalog_management.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class CatalogInfo:
def __init__(self):
self._name = None

@property
def name(self):
return self._name

def set_name(self, name):
self._name = name


catalog_info = CatalogInfo()


def get_catalog(catalog_name):
import databroker
from packaging import version

db_version_major = version.parse(databroker.__version__).major == 1
if db_version_major == 1:
raise ValueError("Non-tiled version of Databroker is installed")

from tiled.client import from_uri

c = from_uri("https://tiled.nsls2.bnl.gov")
return c[catalog_name.lower()]["raw"]
Loading

0 comments on commit eb44f27

Please sign in to comment.