Giter Club home page Giter Club logo

gemviz's People

Contributors

dependabot[bot] avatar mdecarabas avatar olliviergassant avatar prjemian avatar rodolakis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gemviz's Issues

Increase date range for DateTimeRangeSlider

The DateTimeRangeSlider is limited to maximum possible date of: 2038-01-18 21:14:07 (UTC).

Attempts to set the maximum to later dates result in this exception:

    self.slider.setMaximum(self._slider_units(self._maximum))
OverflowError: argument 1 overflowed: value must be in the range -2147483648 to 2147483647

This limitation is imposed by using integer seconds with the slider (from the underlying Qt C++ library): https://github.com/BCDA-APS/tiled-viz2023/blob/fd52533d5aed91d29fd9c9e2b651f74477986255/gemviz23/demo/date_time_range_slider.py#L129

The QSlider uses an integer. The largest integer represents a timestamp resulting in the maximum possible date shown above.

Increase the range of the DateTimeRangeSlider widget by converting the slider to use integer days rather than integer seconds. A pair of conversion methods will help.

draft code for filter result

  • step 1: table displays all the runs (dataset) for the selected catalog (inputBox1) from the filter gui
  • step 2: table display a single run for the selected catalog (inputBox1) and selected scan_id (inputBox2) from the filter gui

run selection

In the resultswindow, when a cell of the table is clicked, the GUI should select the entire row. There is a setting that can be changed in the designer for the QTableView widget. Also, choose the setting for alternating colors for each row.

Use a filtered catalog.

The present code uses the complete catalog from the server. Instead, return a catalog with the filter terms applied.

  • return a filtered catalog (from the filterpanel.py module)
  • disable status widget for now
  • allow for multiple motors to be named
  • configure the DateTimeSlider with info from the catalog

apply naming conventions

Following PEP8, apply naming conventions to the widgets built in the .ui files and also to the Python code we use.

tiled has new releases

Keeping an eye on the tiled releases, note that there are several (at least 5) new releases in the last week.

At least one of them requires a minimum server and client pair that are newer than we use now. Might cause us to change our code, either on the server side or the client side.

improve filter ui

  • replace spin box with QDateTimeEdit for dates
  • replace drop down menus with input boxes
  • explore tooltips to display hints for input boxes

related requests

This issue gathers feature requests from other repos which are related.

BUG: error getting start time of first run from empty catalog

Browsing a catalog and got an error where there were no runs but at least one was expected:

catalogSelected: args = ('30id-nrs30',)  kwargs = {}
Traceback (most recent call last):
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 60, in __getitem__
    (key,) = keys
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/filterpanel.py", line 53, in catalogSelected
    getStartTime(cat.keys().first()),
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 18, in first
    return self[0]
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/iterviews.py", line 62, in __getitem__
    raise IndexError("Index out of range")
IndexError: Index out of range

The application quit completely.

Create a storyboard of the desired GUI

Create a simple sketch of what we think the GUI should look like.

One reference is the dview software, for visualizing MDA file data. PyMCA & NeXpy are other examples but add additional complexity.

look at the tiled client UI

Try the UI client provided by tiled server. It's capable of a lot, it shows many features of the tiled server, but the human interface features are extremely limited. We can develop a list of improvements.

Visualize metadata when run is selected

When a run is selected in the resultswindow, display a representation of its metadata in a tab of the visualization panel.

Needs a visualizationpanel ui/py pair of files. The panel needs to have tabs, at least for plot, data, and metadata.

BUG: Could not page to end of big catalog

Loaded a catalog with 88k runs. The first 20 runs displayed in the results table. After pressing the last pager button, the app crashed with this exception trace:

(bluesky_2023_2) jemian@otz ~/.../gemviz23/demo $ catalogSelected: args = ('developer',)  kwargs = {}
Displaying catalog: developer
catalogSelected: args = ('20idb_usaxs',)  kwargs = {}
Displaying catalog: 20idb_usaxs
action='next' kwargs={}
doPager action ='next', value =None
self.pageOffset() =20 self.pageSize() =20
action='last' kwargs={}
doPager action ='last', value =None
Traceback (most recent call last):
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/resultwindow.py", line 186, in doPagerButtons
    model.doPager(action)
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/resultwindow.py", line 83, in doPager
    self.setUidList(self._get_uidList())
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/resultwindow.py", line 97, in _get_uidList
    return list(gen)
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/client/node.py", line 352, in _keys_slice
    content = self.context.get_json(
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/client/context.py", line 595, in get_json
    self.get_content(
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/client/context.py", line 557, in get_content
    handle_error(response)
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/tiled/client/utils.py", line 29, in handle_error
    response.raise_for_status()
  File "/home/beams/JEMIAN/.conda/envs/bluesky_2023_2/lib/python3.10/site-packages/httpx/_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'http://otz.xray.aps.anl.gov:8000/api/v1/node/search/20idb_usaxs?page%5Boffset%5D=88196&fields=&sort=time'
For more information check: https://httpstatuses.com/500

improve tableview

  • remove quotation and brackets from detector
  • make scan_id text centered
  • adjust column size
  • add positionner to table content

create project

Ollivier does not appears to have the permission to create a project!

Cannot close LICENSE window

Since #26, when the License window is shown, it cannot be closed directly since the About window is modal. Closing the About window closes the license.

FilterPanel.server() does not work

File "/home/beams0/OGASSANT/Documents/tiled-viz2023/gemviz23/demo/resultwindow.py", line 163, in setup
    self.cat = FilterPanel.server(self.mainwindow)['developer']
  File "/home/beams0/OGASSANT/Documents/tiled-viz2023/gemviz23/demo/filterpanel.py", line 35, in server
    return self._server
AttributeError: 'MainWindow' object has no attribute '_server'

identify or setup a tiled server

We'll want at least one tiled server for this work. Might help to have a couple. At least one catalog should provide area detector images.

BUG: some runs do not have a stop document

While browsing a catalog, the app crashed with this exception trace:

Traceback (most recent call last):
  File "/home/beams1/JEMIAN/Documents/projects/BCDA-APS/gemviz23/gemviz23/demo/resultwindow.py", line 51, in data
    return run.metadata.get("stop", {}).get("exit_status", "")
AttributeError: 'NoneType' object has no attribute 'get'

This particular run did not have a stop document.

Add a date/time slider

Add a date/time slider and calendar pop-ups to the filter panel. Replace the existing date/time widget in the filter panel.

Filter time

You can use Pete's function from the utils.py file. Here is an example:

import datetime
def iso2time(isotime):
    return datetime.datetime.timestamp(datetime.datetime.fromisoformat(isotime))

start_time_ISO8601 = "2023-03-17 00:30"
end_time_ISO8601 = "2023-05-19 15:15"

start_timestamp= iso2time(start_time)
end_timestamp=iso2time(end_time)

print(f"{start_time_ISO8601 = }")
print(f"{start_timestamp = }")

print(f"{end_time_ISO8601 = }")
print(f"{end_timestamp = }")

connect server, choose catalog, start filtering

With #30 & #31 complete, it is time to integrate the steps to

  1. choose a tiled server (already done in File -> Open)
  2. try to connect with the server
  3. find out what catalogs are available
  4. handle user selection of a catalog

Anything to save in the settings?

promote the demo contents up one folder

The demo application is in the tiled-viz2023/gemviz23/demo folder. Re-arrange the repository from

tiled-viz2023/
    gemviz23/
        demo/
        test/
        ui_files/

to

tiled-viz2023/
    developer/
        test/
        ui_files/
    gemviz23/

where the demo application is in the tiled-viz2023/gemviz23 folder and the other two directories are relocated to the tiled-viz2023/developer folder

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.