nova-trame 0.20.4__py3-none-any.whl → 0.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,17 +212,18 @@ class DataSelectorModel:
212
212
  def get_datafiles(self) -> List[str]:
213
213
  datafiles = []
214
214
 
215
+ if self.state.experiment:
216
+ base_path = Path("/") / self.state.facility / self.get_instrument_dir() / self.state.experiment
217
+ elif self.state.custom_directory:
218
+ base_path = Path(self.state.custom_directory)
219
+ else:
220
+ return []
221
+
215
222
  try:
216
223
  if self.state.prefix:
217
- datafile_path = str(
218
- Path("/")
219
- / self.state.facility
220
- / self.get_instrument_dir()
221
- / self.state.experiment
222
- / self.state.prefix
223
- )
224
+ datafile_path = str(base_path / self.state.prefix)
224
225
  else:
225
- datafile_path = self.state.directory
226
+ datafile_path = str(base_path / self.state.directory)
226
227
 
227
228
  for entry in os.scandir(datafile_path):
228
229
  if entry.is_file():
@@ -45,6 +45,26 @@ class ProgressBar:
45
45
  v_show=(f"{self.id}.show_progress",),
46
46
  ):
47
47
  html.H5(v_text=f"{self.id}.details")
48
+ with vuetify.VMenu(
49
+ max_width=900,
50
+ location="bottom",
51
+ no_click_animation=True,
52
+ close_on_content_click=False,
53
+ open_on_hover=True,
54
+ v_show=False,
55
+ ):
56
+ with vuetify.Template(v_slot_activator="{ props }"):
57
+ vuetify.VIcon(
58
+ "mdi-information",
59
+ v_show=f"{self.id}.show_full_details",
60
+ v_bind="props",
61
+ classes="ml-2",
62
+ color="primary",
63
+ )
64
+
65
+ with vuetify.VCard(classes="bg-grey"):
66
+ vuetify.VCardText(f"{{{{ {self.id}.full_details }}}}", classes="display-linebreaks")
67
+
48
68
  with vuetify.VProgressLinear(
49
69
  height="25",
50
70
  model_value="100",
@@ -16,6 +16,10 @@ html {
16
16
  display: none !important;
17
17
  }
18
18
 
19
+ .display-linebreaks {
20
+ white-space: pre-wrap;
21
+ }
22
+
19
23
  .nova-data-selector revo-grid {
20
24
  font-family: 'Roboto', sans-serif;
21
25
  font-size: 0.75rem !important;
@@ -209,3 +213,6 @@ html {
209
213
  }
210
214
  }
211
215
  }
216
+
217
+
218
+ .v-progress-linear__content { pointer-events: all !important; }
@@ -1,6 +1,7 @@
1
1
  """Module for the JobProgress ViewModel."""
2
2
 
3
- from typing import Any
3
+ import json
4
+ from typing import Any, Dict, Tuple
4
5
 
5
6
  import blinker
6
7
  from pydantic import BaseModel
@@ -10,7 +11,7 @@ from nova.common.signals import Signal, get_signal_id
10
11
  from nova.mvvm.interface import BindingInterface
11
12
 
12
13
 
13
- def details_from_state(state: WorkState) -> str:
14
+ def details_from_state(state: WorkState, details: Dict[str, Any]) -> Tuple[str, str]:
14
15
  work_state_map = {
15
16
  WorkState.NOT_STARTED: "job not started",
16
17
  WorkState.UPLOADING_DATA: "uploading data",
@@ -24,9 +25,12 @@ def details_from_state(state: WorkState) -> str:
24
25
  WorkState.CANCELING: "canceling job",
25
26
  }
26
27
  if state in work_state_map:
27
- return work_state_map[state]
28
+ state_str = work_state_map[state]
28
29
  else:
29
- return state.value
30
+ state_str = state.value
31
+
32
+ full_details_dict = json.dumps(details.get("original_dict", {}), indent=4)
33
+ return state_str, full_details_dict
30
34
 
31
35
 
32
36
  class ProgressState(BaseModel):
@@ -34,11 +38,13 @@ class ProgressState(BaseModel):
34
38
 
35
39
  progress: str = ""
36
40
  details: str = ""
41
+ full_details: str = ""
37
42
  show_progress: bool = False
43
+ show_full_details: bool = False
38
44
  show_failed: bool = False
39
45
  show_ok: bool = False
40
46
 
41
- def update_from_workstate(self, state: WorkState) -> None:
47
+ def update_from_workstate(self, state: WorkState, details: Dict[str, Any]) -> None:
42
48
  progress = "0"
43
49
  match state:
44
50
  case WorkState.UPLOADING_DATA:
@@ -58,7 +64,8 @@ class ProgressState(BaseModel):
58
64
  self.show_failed = state == WorkState.ERROR
59
65
  self.show_ok = state == WorkState.FINISHED
60
66
  self.progress = progress
61
- self.details = details_from_state(state)
67
+ self.details, self.full_details = details_from_state(state, details)
68
+ self.show_full_details = self.full_details != "{}"
62
69
 
63
70
 
64
71
  class ProgressBarViewModel:
@@ -70,6 +77,6 @@ class ProgressBarViewModel:
70
77
  self.progress_signal = blinker.signal(get_signal_id(id, Signal.PROGRESS))
71
78
  self.progress_signal.connect(self.update_state, weak=False)
72
79
 
73
- async def update_state(self, _sender: Any, state: WorkState, details: str) -> None:
74
- self.progress_state.update_from_workstate(state)
80
+ async def update_state(self, _sender: Any, state: WorkState, details: Dict[str, Any]) -> None:
81
+ self.progress_state.update_from_workstate(state, details)
75
82
  self.progress_state_bind.update_in_view(self.progress_state)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nova-trame
3
- Version: 0.20.4
3
+ Version: 0.21.0
4
4
  Summary: A Python Package for injecting curated themes and custom components into Trame applications
5
5
  License: MIT
6
6
  Keywords: NDIP,Python,Trame,Vuetify
@@ -1,13 +1,13 @@
1
1
  nova/__init__.py,sha256=ED6jHcYiuYpr_0vjGz0zx2lrrmJT9sDJCzIljoDfmlM,65
2
2
  nova/trame/__init__.py,sha256=gFrAg1qva5PIqR5TjvPzAxLx103IKipJLqp3XXvrQL8,59
3
- nova/trame/model/data_selector.py,sha256=p-4SuK4IQpsd_JrzZ-tysba7GYpjIyAbsxLcBgrw5h4,8997
3
+ nova/trame/model/data_selector.py,sha256=wIskRs3IzRgfXPT3jBJFYAAy3vy8wfX-gTyUNbmh89w,9101
4
4
  nova/trame/model/remote_file_input.py,sha256=9KAf31ZHzpsh_aXUrNcF81Q5jvUZDWCzW1QATKls-Jk,3675
5
5
  nova/trame/view/components/__init__.py,sha256=60BeS69aOrFnkptjuD17rfPE1f4Z35iBH56TRmW5MW8,451
6
6
  nova/trame/view/components/data_selector.py,sha256=sAA0v9lLhqkuC4WqRYe8c_banXz8ZOZEgf24NzG5Kjk,11097
7
7
  nova/trame/view/components/execution_buttons.py,sha256=fIkrWKI3jFZqk3GHhtmYh3nK2c-HOXpD3D3zd_TUpi0,4049
8
8
  nova/trame/view/components/file_upload.py,sha256=7VcpfA6zmiqMDLkwVPlb35Tf0IUTBN1xsHpoUFnSr1w,3111
9
9
  nova/trame/view/components/input_field.py,sha256=q6WQ_N-BOlimUL9zgazDlsDfK28FrrKjH4he8e_HzRA,16088
10
- nova/trame/view/components/progress_bar.py,sha256=Sh5cOPaMWrFq8KTWEDui1dIbK53BPtGG2RZOSKEaoJ4,2186
10
+ nova/trame/view/components/progress_bar.py,sha256=fCfPw4MPAvORaeFOXugreok4GLpDVZGMkqvnv-AhMxg,2967
11
11
  nova/trame/view/components/remote_file_input.py,sha256=ByrBFj8svyWezcardCWrS_4Ag3fgTYNg_11lDW1FIA8,9669
12
12
  nova/trame/view/components/tool_outputs.py,sha256=-6pDURd2l_FK_8EWa9BI3KhU_KJXJ6uyJ_rW4nQVc08,2337
13
13
  nova/trame/view/components/visualization/__init__.py,sha256=reqkkbhD5uSksHHlhVMy1qNUCwSekS5HlXk6wCREYxU,152
@@ -19,7 +19,7 @@ nova/trame/view/layouts/hbox.py,sha256=qlOMp_iOropIkC9Jxa6D89b7OPv0pNvJ73tUEzddy
19
19
  nova/trame/view/layouts/utils.py,sha256=Hg34VQWTG3yHBsgNvmfatR4J-uL3cko7UxSJpT-h3JI,376
20
20
  nova/trame/view/layouts/vbox.py,sha256=hzhzPu99R2fAclMe-FwHZseJWk7iailZ31bKdGhi1hk,3514
21
21
  nova/trame/view/theme/__init__.py,sha256=70_marDlTigIcPEOGiJb2JTs-8b2sGM5SlY7XBPtBDM,54
22
- nova/trame/view/theme/assets/core_style.scss,sha256=7tU0EVIg9egxq1XjhqNFq_nUwSFSHAhqivgLdbf9oj4,3829
22
+ nova/trame/view/theme/assets/core_style.scss,sha256=K-0lz-bHSeIqKWWx-e6YyRiGMhxW850rT811M_Z9A4g,3947
23
23
  nova/trame/view/theme/assets/favicon.png,sha256=Xbp1nUmhcBDeObjsebEbEAraPDZ_M163M_ZLtm5AbQc,1927
24
24
  nova/trame/view/theme/assets/js/delay_manager.js,sha256=mRV6KoO8-Bxq3tG5Bh9CQYy-CRVbkj3IYlqNb-Og7cI,526
25
25
  nova/trame/view/theme/assets/js/lodash.min.js,sha256=KCyAYJ-fsqtp_HMwbjhy6IKjlA5lrVrtWt1JdMsC57k,73016
@@ -29,11 +29,11 @@ nova/trame/view/theme/theme.py,sha256=0KzBJgAZRwlnwzCIf7gUjDY-gbhON7b2h3CMh2_9HY
29
29
  nova/trame/view/utilities/local_storage.py,sha256=vD8f2VZIpxhIKjZwEaD7siiPCTZO4cw9AfhwdawwYLY,3218
30
30
  nova/trame/view_model/data_selector.py,sha256=llI7u8121R78dkecS4D2OI604LWlpByWn7OL9cckI9Q,2561
31
31
  nova/trame/view_model/execution_buttons.py,sha256=MfKSp95D92EqpD48C15cBo6dLO0Yld4FeRZMJNxJf7Y,3551
32
- nova/trame/view_model/progress_bar.py,sha256=L7ED6TDn5v2142iu-qt3i-jUg_5JEhLyC476t2OtohU,2467
32
+ nova/trame/view_model/progress_bar.py,sha256=6AUKHF3hfzbdsHqNEnmHRgDcBKY5TT8ywDx9S6ovnsc,2854
33
33
  nova/trame/view_model/remote_file_input.py,sha256=ojEOJ8ZPkajpbAaZi9VLj7g-uBjhb8BMrTdMmwf_J6A,3367
34
34
  nova/trame/view_model/tool_outputs.py,sha256=ev6LY7fJ0H2xAJn9f5ww28c8Kpom2SYc2FbvFcoN4zg,829
35
- nova_trame-0.20.4.dist-info/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
36
- nova_trame-0.20.4.dist-info/METADATA,sha256=48Ob64yY74oD4ppjh9h_Kf01diDGKDx1uKdHzIZaIUM,1603
37
- nova_trame-0.20.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
- nova_trame-0.20.4.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
39
- nova_trame-0.20.4.dist-info/RECORD,,
35
+ nova_trame-0.21.0.dist-info/LICENSE,sha256=Iu5QiDbwNbREg75iYaxIJ_V-zppuv4QFuBhAW-qiAlM,1061
36
+ nova_trame-0.21.0.dist-info/METADATA,sha256=5CG-2qrSc-0EGDteFilNzFjbtlm_k8oZTYx8XLPv63o,1603
37
+ nova_trame-0.21.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
+ nova_trame-0.21.0.dist-info/entry_points.txt,sha256=J2AmeSwiTYZ4ZqHHp9HO6v4MaYQTTBPbNh6WtoqOT58,42
39
+ nova_trame-0.21.0.dist-info/RECORD,,