Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI FOR AUTOMATED PLOTTING 2- update the GUI #2464

Merged
merged 31 commits into from
Sep 30, 2024

Conversation

Preetam-Das26
Copy link
Collaborator

Purpose of PR?:

Fixes #

Does this PR introduce a breaking change?

If the changes in this PR are manually verified, list down the scenarios covered::

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes

Checklist:

  • Bug fix. Fixes #
  • New feature (Non-API breaking changes that adds functionality)
  • PR Title follows the convention of <type>: <subject>
  • Commit has unit tests

@ReimarBauer
Copy link
Member

On an operation the filename column is used (ok), but an operation has no extension

I start with AIRS(ECMWF) and click then Add - something of the data is changed

example_add

How and What?

@ReimarBauer
Copy link
Member

ReimarBauer commented Aug 16, 2024

On an operation the filename column is used (ok), but an operation has no extension

I start with AIRS(ECMWF) and click then Add - something of the data is changed

example_add example_add

How and What?

lookslike I had a transmission failure.

@ReimarBauer
Copy link
Member

when I resize it also or also change the width of the column the left treewidget keeps a lot of space. Could you enable that both take only the space they needs?

image

@ReimarBauer
Copy link
Member

While the UI in the Multilayer selector can use direct the cached images from the defined dir in the configuration. For me it is tmp/msui_wms_cache the autoplot does on each load the capabilities. This needs usually only done once. This gives a delay. Please look if you can skip this "get capability" request.

example_wmsc

@ReimarBauer
Copy link
Member

ReimarBauer commented Aug 16, 2024

When storing such a configuration one has to add .json. There is suppot by qt for this https://doc.qt.io/qt-6/qfiledialog.html#defaultSuffix-prop

reloading from file works too. :)

Download Plots crashes

default
Style 'autolog' not found for layer 'CLaMS_PL.mole_fraction_of_CH3Br_in_air_pl'.
log  | 
Style 'autolog' not found for layer 'CLaMS_PL.mole_fraction_of_CH3Br_in_air_pl'.
Usage: autoplot_gui [OPTIONS]
Try 'autoplot_gui --help' for help.

Error: Invalid value for '--intv': '' is not a valid integer.
Speicherzugriffsfehler

@ReimarBauer
Copy link
Member

Restoring the level is not implemented?

@ReimarBauer
Copy link
Member

The recent change creates an error for me

problem

@Preetam-Das26 Preetam-Das26 marked this pull request as ready for review September 19, 2024 06:14
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please can you undo your merge of develop into the PR?

This does not reflect the state of the work during GSOC
We have to do the following order, squash merge the PR to your Gsoc branch.
merge the gsoc branch to develop.

You can ignore the failing tests, because we know the reason.

@ReimarBauer
Copy link
Member

with temporary applying https://github.com/Open-MSS/MSS/pull/2537/files#diff-2ba1f11e715e19bf607aa39b8541650e9cc7062cea55288accced904af34d3ca

542 passed, 13 skipped, 32 warnings in 434.61s (0:07:14)

@@ -51,7 +51,7 @@
from mslib.msui.icons import icons, python_powered
from mslib.utils.qt import get_open_filenames, get_save_filename, show_popup
from mslib.utils.config import read_config_file, config_loader
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5 import QtGui, QtCore, QtWidgets, QtTest
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is an interesting usecase, we have to lookup afterwards

@@ -83,6 +83,9 @@ class MSUILinearViewWindow(MSUIMplViewWindow, ui.Ui_LinearWindow):

refresh_signal_send = QtCore.pyqtSignal()
refresh_signal_emit = QtCore.pyqtSignal()
item_selected = QtCore.pyqtSignal(str, str, str, str)
vtime_vals = QtCore.pyqtSignal([list])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a review after the merge how the list evolves

@@ -0,0 +1,97 @@
GUI FOR AUTOMATED PLOTTING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename needs to be lowercase later

from mslib.msui.qt5.ui_mss_autoplot import Ui_AutoplotDockWidget
from mslib.msui import constants as const
from datetime import datetime

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be reordered later

autoplot_treewidget_item_selected = QtCore.pyqtSignal(str, str)
update_op_flight_treewidget = QtCore.pyqtSignal(str, str)

def __init__(self, parent=None, parent2=None, view=None, config_settings=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the parent names can become more meaningful

@@ -256,6 +256,9 @@ class MSUISideViewWindow(MSUIMplViewWindow, ui.Ui_SideViewWindow):

refresh_signal_send = QtCore.pyqtSignal()
refresh_signal_emit = QtCore.pyqtSignal()
item_selected = QtCore.pyqtSignal(str, str, str, str)
vtime_vals = QtCore.pyqtSignal([list])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to check later how the list evolves

@@ -190,6 +190,9 @@ class MSUITopViewWindow(MSUIMplViewWindow, ui.Ui_TopViewWindow):
sections_changed = QtCore.pyqtSignal(str)
refresh_signal_emit = QtCore.pyqtSignal()
refresh_signal_send = QtCore.pyqtSignal()
item_selected = QtCore.pyqtSignal(str, str, str, str)
itemSecs_selected = QtCore.pyqtSignal(str)
vtime_vals = QtCore.pyqtSignal([list])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to check later how the list evolves

@@ -426,10 +455,11 @@ def level_val_changed(self, strr):

@QtCore.pyqtSlot()
def styles_val_changed(self, strr):
if strr is None:
if strr is None or not str(strr).strip():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can become a better name later

@@ -410,6 +410,7 @@ class WMSControlWidget(QtWidgets.QWidget, ui.Ui_WMSDockWidget):
styles_changed = QtCore.pyqtSignal(str)
itime_changed = QtCore.pyqtSignal(str)
vtime_changed = QtCore.pyqtSignal(str)
vtime_data = QtCore.pyqtSignal([list])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to check later how the list evolves

# Iterate over the children of the top-level item
for i in range(top_item.childCount()):
child_item = top_item.child(i)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review for empty formatting lines later

self.current_sel_layer = child_item

if not self.current_sel_layer:
print(f"Layer '{layer_name}' not found.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when that is important only a popup reaches the user, needs to become checked later



def get_xml_data(mscolab_server_url, token, op_id):
if verify_user_token(mscolab_server_url, token):
Copy link
Member

@ReimarBauer ReimarBauer Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a change after the merge, because in develop this verify_user_token was refactored.


def get_op_id(token, mscolab_server_url, curr_op):
logging.debug('get_recent_op_id')
if verify_user_token(mscolab_server_url, token):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above



if __name__ == '__main__':
main()
cli_tool()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs an additional change in https://github.com/Open-MSS/MSS/blob/develop/setup.py#L39

I am not convinced by the new name.

import requests
from urllib.parse import urljoin
import json
from PyQt5.QtCore import Qt

Copy link
Member

@ReimarBauer ReimarBauer Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

later imports should be sorted later, https://peps.python.org/pep-0008/#imports

Imports should be grouped in the following order:

Standard library imports.
Related third party imports.
Local application/library specific imports.

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a crash from sideview when I try to download plots to be solved after this got merged

Python 3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:40:35) [GCC 12.3.0]

Please report bugs in MSS to https://github.com/Open-MSS/MSS

Information about the fatal error:

Traceback (most recent call last):
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/msui/autoplot_dockwidget.py", line 147, in <lambda>
    self.downloadPushButton.clicked.connect(lambda: self.download_plots_cli(config_settings))
                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/msui/autoplot_dockwidget.py", line 199, in download_plots_cli
    ctx.invoke(cli_tool, **args)
  File "/home/reimar/Miniforge/envs/mssdev/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reimar/Miniforge/envs/mssdev/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/utils/mssautoplot.py", line 470, in cli_tool
    side_view = SideViewPlotting(cpath, mss_url, mss_password, mss_auth)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/utils/mssautoplot.py", line 281, in __init__
    super(SideViewPlotting, self).__init__(cpath)
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/utils/mssautoplot.py", line 176, in __init__
    self.read_operation(flight, username, password, mscolab_server_url)
  File "/home/reimar/PycharmProjects/2024/Preetam-Das26/MSS/mslib/utils/mssautoplot.py", line 198, in read_operation
    self.wps, self.wp_model_data = load_from_operation(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some work to do, which should be done in more than one PR.

This is a good step further and it is a nice functionality

@ReimarBauer ReimarBauer merged commit d9ce793 into Open-MSS:GSOC2024-PreetamSundarDas Sep 30, 2024
5 of 10 checks passed
@Preetam-Das26 Preetam-Das26 deleted the gsoc_psd branch October 1, 2024 05:51
ReimarBauer pushed a commit that referenced this pull request Oct 4, 2024
update msui mainwindow based on left treewidget, download from operations implemented completely and prcess dialogs added, update msui mainwindow based on left treewidget,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants