Skip to content
Snippets Groups Projects

Build XASObject in GUI via read_from_input_information

Merged Loic Huder requested to merge refactor-input-info into main
2 unresolved threads

Fix #88 (closed)

Thanks to previous refactorings, I was able to completely replace the custom loading code in XASObjectDialog by a simple call to read_from_input_information.

The building of XASObject is now consistent between the GUI and the Ewoks task: both use read_from_input_information. The only difference is that the GUI generates its own input_information by reading the QtWidget values while the Ewoks task takes it as input (if I dare say).

Edited by Loic Huder

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
7 from est.core.io import read_from_url
8 from est.core.io import read_from_ascii
8 from est.core.io import read_from_input_information
9 9 from est.io.information import InputInformation
10 10 from est.io.utils.ascii import build_ascii_data_url
11 11 from .ascii import XASObjectFromAscii
12 12 from .hdf5 import XASObjectFromH5
13 13
14 14
15 def _check_url(url_path, name):
16 if isinstance(url_path, DataUrl):
17 url = url_path
18 else:
19 url = DataUrl(path=url_path)
20 if not url.is_valid():
21 raise ValueError(f"{name} url is invalid. Does the file / path still exists ?")
  • I removed this check for several reasons:

    • it fails for valid ASCII URLs (is_valid is False because larch, pymca are not valid schemes for silx)
    • If the file/path does not exists, an error is raised way before arriving to this step, making this check redundant
  • Please register or sign in to reply
  • Loic Huder marked this merge request as ready

    marked this merge request as ready

  • Loic Huder requested review from @payno

    requested review from @payno

  • 239 208 )
    240 209
    241 210 def getMonitorUrl(self):
    211 # TODO" UNUSED
  • payno approved this merge request

    approved this merge request

  • Loic Huder added 1 commit

    added 1 commit

    • ab93406a - Remove unused getters in XASObjectDialog

    Compare with previous version

  • merged

  • Loic Huder mentioned in commit f4b8ea69

    mentioned in commit f4b8ea69

  • Loic Huder mentioned in merge request !148 (merged)

    mentioned in merge request !148 (merged)

  • Please register or sign in to reply
    Loading