Skip to content

Commit

Permalink
fixed 57
Browse files Browse the repository at this point in the history
  • Loading branch information
rikigigi committed Feb 23, 2022
1 parent d40c0c1 commit 122468f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 29 deletions.
4 changes: 2 additions & 2 deletions examples/example_cepstrum_doublecomp_NaCl.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9463,7 +9463,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -9477,7 +9477,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.8.5"
},
"widgets": {
"state": {},
Expand Down
4 changes: 4 additions & 0 deletions sportran_gui/assets/languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"fw_low": "Filter width can't be less than 0",
"fw_void": "Filter width can't be void",
"automatic_T": "The temperature will be automatically calculated",
"automatic_V": "The volume will be automatically calculated",
"automatic_DT": "The DT_FS will be automatically calculated",
"back_reset": "Go back?",
"back_reset_t": "Save changes?\nIf reopen the same file\nthe values that you chosed will not be deleted!",
"fs_loaded": "F* loaded from input file ({})",
Expand Down Expand Up @@ -191,6 +193,8 @@
"fw_low": "La larghezza del filtro non può essere negativa",
"fw_void": "Il campo \"larghezza del filtro\" non può essere vuoto",
"automatic_T": "La temperatura verrà calcolata automaticamente",
"automatic_V": "Il volume verrà calcolato automaticamente",
"automatic_DT": "Il timestep verrà calcolato automaticamente",
"back_reset": "Andare indietro?",
"back_reset_t": "Salvo le modifiche?\nSe si riapre lo stesso file\ni valori scelti non saranno cancellati!",
"fs_loaded": "F* caricato dal file di input ({})"
Expand Down
4 changes: 2 additions & 2 deletions sportran_gui/interfaces/headerSelector.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def next(self):
if cu.Data.options[1] in description: #energy current
if description.count(cu.Data.options[1]) == 1:
if description.count(cu.Data.options[3]) <= 1: #temperature
if description.count(cu.Data.options[4]) <= 1:
if description.count(cu.Data.options[5]) <= 1:
if description.count(cu.Data.options[4]) <= 1: #volume
if description.count(cu.Data.options[5]) <= 1: #DT
cu.data.keys = keys
cu.data.description = description
cu.Data.loaded = True
Expand Down
64 changes: 39 additions & 25 deletions sportran_gui/interfaces/otherVariables.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,31 +167,45 @@ def update(self):
self.DT_FS_entry.config(state=NORMAL)
self.volume_entry.config(state=NORMAL)

if cu.data.inputformat == 'dict':
if True: #not cu.Data.loaded:
if cu.Data.options[3] in cu.data.description:
self.temp_advertise.config(text=LANGUAGES[settings.LANGUAGE]['automatic_T'], fg='red')
temp = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[3])]]
if type(temp) == float:
cu.data.temperature = temp
else:
cu.data.temperature = temp.mean()
cu.data.temperature_std = temp.std()
self.temperature_entry.config(state=DISABLED)
if cu.Data.options[4] in cu.data.description:
self.volume_advertise.config(text='The volume will be automatically calculated', fg='red')
vol = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[4])]]
if type(vol) == float:
cu.data.volume = vol
else:
cu.data.volume = vol.mean()
self.volume_entry.config(state=DISABLED)
if cu.Data.options[5] in cu.data.description:
self.DT_FS_advertise.config(text='The DT_FS will be automatically calculated', fg='red')
cu.data.DT_FS = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[5])]]
self.DT_FS_entry.config(state=DISABLED)

self.update_data()
if cu.Data.options[3] in cu.data.description:
self.temp_advertise.config(text=LANGUAGES[settings.LANGUAGE]['automatic_T'], fg='red')
if cu.data.inputformat == 'dict': #only for dict I have the data here
temp = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[3])]]
if type(temp) == float:
cu.data.temperature = temp
else:
cu.data.temperature = temp.mean()
cu.data.temperature_std = temp.std()
self.temperature_entry.config(state=DISABLED)
else:
self.temperature_entry.config(state=NORMAL)
self.temp_advertise.config(text='')
if cu.Data.options[4] in cu.data.description:
self.volume_advertise.config(text=LANGUAGES[settings.LANGUAGE]['automatic_V'], fg='red')
if cu.data.inputformat == 'dict': #only for dict I have the data here
vol = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[4])]]
if type(vol) == float:
cu.data.volume = vol
else:
cu.data.volume = vol.mean()
else:
raise RuntimeError('NOT IMPLEMENTED')
self.volume_entry.config(state=DISABLED)
else:
self.volume_advertise.config(text='')
self.volume_entry.config(state=NORMAL)
if cu.Data.options[5] in cu.data.description:
self.DT_FS_advertise.config(text=LANGUAGES[settings.LANGUAGE]['automatic_DT'], fg='red')
if cu.data.inputformat == 'dict': #only for dict I have the data here
cu.data.DT_FS = cu.data.jdata[cu.data.keys[cu.data.description.index(cu.Data.options[5])]]
else:
raise RuntimeError('NOT IMPLEMENTED')
self.DT_FS_entry.config(state=DISABLED)
else:
self.DT_FS_advertise.config(text='')
self.DT_FS_entry.config(state=NORMAL)

self.update_data()

self.main_frame.viewPort.columnconfigure(0, weight=1)
self.main_frame.viewPort.rowconfigure(0, weight=1)
Expand Down

0 comments on commit 122468f

Please sign in to comment.