Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Tiled at SRX beamline #315

Merged
merged 16 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading