Skip to content

Commit

Permalink
Merge branch 'main' into 201-refactor-self.selections-per-Qt-pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Feb 28, 2024
2 parents d1d6cf7 + 486575b commit e47e4ad
Show file tree
Hide file tree
Showing 22 changed files with 213 additions and 27 deletions.
2 changes: 1 addition & 1 deletion gemviz/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2023, UChicago Argonne, LLC
Copyright (c) 2023-2024, UChicago Argonne, LLC

All Rights Reserved

Expand Down
10 changes: 9 additions & 1 deletion gemviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@

# fmt: off
COPYRIGHT_TEXT = (
"(c) 2023, UChicago Argonne, LLC"
"(c) 2023-2024, UChicago Argonne, LLC"
", (see LICENSE file for details)"
)
# fmt: on
DOCS_URL = "https://github.com/BCDA-APS/gemviz/blob/main/README.md"
ISSUES_URL = "https://github.com/BCDA-APS/gemviz/issues"
LICENSE_FILE = ROOT_DIR / "LICENSE"

# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/aboutdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ def clearStatus(self):

def setStatus(self, text):
self.parent.setStatus(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
8 changes: 8 additions & 0 deletions gemviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ def main():

if __name__ == "__main__":
main()

# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
17 changes: 16 additions & 1 deletion gemviz/bluesky_runs_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ def doRunSelectedSlot(self, run):

run_md = run.run_md
self.brc_run_viz.setMetadata(yaml.dump(dict(run_md), indent=4))
self.brc_run_viz.setData(self.getDataDescription(run))
try:
self.brc_run_viz.setData(self.getDataDescription(run))
except (KeyError, ValueError) as exinfo:
self.setStatus(
f"Can't select that run: ({exinfo.__class__.__name__}) {exinfo}"
)
return
self.setStatus(run.summary())
self.selected_run_uid = run.get_run_md("start", "uid")

Expand Down Expand Up @@ -214,3 +220,12 @@ def splitter_wait_changes(self, key):

def setStatus(self, text):
self.parent.setStatus(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/bluesky_runs_catalog_run_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ def setPlot(self, plot_widget):

def setStatus(self, text):
self.parent.setStatus(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/bluesky_runs_catalog_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ def filteredCatalog(self):

def setStatus(self, text):
self.parent.setStatus(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/bluesky_runs_catalog_table_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,12 @@ def setRuns(self, runs):
"""
self.runs = runs
self.layoutChanged.emit() # Tell the view there is new data.


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/bluesky_runs_catalog_table_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,12 @@ def catalogLength(self):

def setStatus(self, text):
self.parent.setStatus(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/chartview.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,12 @@ def setLeftAxisUnits(self, text):

def setPlotTitle(self, text):
self.plot_widget.plotItem.setTitle(text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
8 changes: 8 additions & 0 deletions gemviz/date_time_range_slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,11 @@ def setLimits(self, low, high):
# main.raise_()
app.exec()
print(f"{main.low()=} {main.high()=}")

# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/licensedialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ def setup(self):
self.setModal(True)
license_text = open(LICENSE_FILE, "r").read()
self.license.setText(license_text)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,12 @@ def setServer(self, uri, server):
"""Define the tiled server URI."""
self._server = server
self.setCatalogs(list(server))


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/range_slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,12 @@ def __pixelPosToRangeValue(self, pos):
slider_max - slider_min,
opt.upsideDown,
)


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/select_fields_tablemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,12 @@ def plotFields(self):
elif column_number in self.multipleSelectionColumns:
choices[column_name].append(field_name)
return choices


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/select_fields_tableview.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@ def displayTable(self, columns, fields):
def responder(self, action):
"""Modify the plot with the described action."""
self.selected.emit(action, self.tableView.model().plotFields())


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/select_stream_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,12 @@ def to_datasets(run, stream_name, selections, scan_id=None):
}

return datasets, plot_options


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/tapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,12 @@ def get_tiled_runs(cat, since=None, until=None, text=[], text_case=[], **keys):
for v in text_case:
cat = cat.search(tiled.queries.FullText(v, case_sensitive=True))
return cat


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/tiledserverdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,12 @@ def getServer(parent):
selected = dialog.other_url.text()

return selected


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
42 changes: 25 additions & 17 deletions gemviz/user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,28 @@ def restoreSplitter(self, splitter, label):
settings = ApplicationQSettings(__settings_orgName__, __package_name__)


def main():
ss = settings
print(f"{ss=}")

print(f"{ss.fileName()=}")
print(f"{ss.applicationName()=}")
print(f"{ss.organizationName()=}")
print(f"{ss.status()=}")
ss.setKey("billy/goat", "gruff")
for key in ss.allKeys():
print(f"{key=} {ss.getKey(key)=} {ss._keySplit_(key)=}")
print(f"{ss.getKey(None)=}")
ss.resetDefaults()


if __name__ == "__main__":
main()
# def main():
# ss = settings
# print(f"{ss=}")

# print(f"{ss.fileName()=}")
# print(f"{ss.applicationName()=}")
# print(f"{ss.organizationName()=}")
# print(f"{ss.status()=}")
# ss.setKey("billy/goat", "gruff")
# for key in ss.allKeys():
# print(f"{key=} {ss.getKey(key)=} {ss._keySplit_(key)=}")
# print(f"{ss.getKey(None)=}")
# ss.resetDefaults()


# if __name__ == "__main__":
# main()

# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions gemviz/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,12 @@ def myLoadUi(ui_file, baseinstance=None, **kw):
def getUiFileName(py_file_name):
"""UI file name matches the Python file, different extension."""
return f"{pathlib.Path(py_file_name).stem}.ui"


# -----------------------------------------------------------------------------
# :copyright: (c) 2023-2024, UChicago Argonne, LLC
#
# Distributed under the terms of the Argonne National Laboratory Open Source License.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------------------
18 changes: 11 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[build-system]
# qt ==5
# pyqt ==5
requires = [
"pyRestTable",
"setuptools>=61.0",
"setuptools_scm[toml]>=6.2",
"tiled"
"setuptools>=64",
"setuptools_scm[toml]>=8",
]
build-backend = "setuptools.build_meta"

Expand All @@ -23,7 +19,7 @@ maintainers = [
]
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.8, <3.12"
keywords = ["bluesky", "databroker", "tiled", "catalog"]
# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/?highlight=license
license = {file = "gemviz/LICENSE"}
Expand Down Expand Up @@ -51,6 +47,14 @@ classifiers = [
"Topic :: Utilities",
]

# qt ==5
# pyqt ==5
dependencies = [
"pyqtgraph",
"pyRestTable",
"tiled",
]

[project.urls]
"Homepage" = "https://github.com/BCDA-APS/gemviz"
"Bug Tracker" = "https://github.com/BCDA-APS/gemviz/issues"
Expand Down

0 comments on commit e47e4ad

Please sign in to comment.