CEMPD / VERDI

This is the repo for the VERDI project, written in java.
GNU General Public License v3.0
17 stars 13 forks source link

Saving/opening VERDI project #318

Closed dkang2 closed 10 months ago

dkang2 commented 1 year ago

Describe the bug On Linux machine, I have a few opened datasets and several formulas and want to save it as a project for later work. When I clicked File -> Save Project As, a pop-up window opened, and a directory and project name was given, then clicked Save. But when came back to the directory, the saved project file was not there. Neither I tried to open the project that was saved from the directory from VERDI GUI: File -> Open Project

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

dkang2 commented 1 year ago

Just tested the 20230425 build. I was able to save a project onto file and the file does exist. But when I reopened verdi and tried to open the project, nothing happens. image

yadongxuEPA commented 1 year ago

Retested VERDI 2.1.4 20230526 builds on Atmos, found that this issue has not resolved. No content was saved in the saved-project filename.

yadongxuEPA commented 1 year ago

Retested VERDI 2.1.4 20230831 builds on Atmos, found that this issue has resolved. Now "Save Project" and "Save Project As" work as described in the user manual.

issue_318_user_manual_1 Step 1: load the saved project into VERDI issue_318_open_project Step 2: check if the dataset was saved and loaded (Yes) issue_318_open_project_dataset Step 3: check if the formula was saved and loaded (Yes) issue_318_open_project_formulas

dkang2 commented 1 year ago

The VERDI 2.1.4 20230911 build seems reversed earlier fix for this problem. The project is saved, but when re-open it, nothing happens, no contents.

dkang2 commented 1 year ago

In fact, the "Save Project As" function doesn't work either with the 20230911 build with the following error message:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.thoughtworks.xstream.converters.collectionseeMapConverter at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:807) at com.thoughtworks.xstream.XStream.(XStream.java:574) at com.thoughtworks.xstream.XStream.(XStream.java:496) at com.thoughtworks.xstream.XStream.(XStream.java:465) at com.thoughtworks.xstream.XStream.(XStream.java:411) at com.thoughtworks.xstream.XStream.(XStream.java:350) at anl.verdi.io.IO.save(IO.java:115) at anl.verdi.core.VerdiApplication.doSave(VerdiApplication.java:349) at anl.verdi.core.VerdiApplication.saveProjectAs(VerdiApplication.java:364) at anl.verdi.core.action.SaveAsAction.actionPerformed(SaveAsAction.java:25) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

dkang2 commented 1 year ago

The issue was resolved. It now successfully saves and opens project as expected.

yadongxuEPA commented 1 year ago

Retested VERDI 2.1.4 20230911 and 20230924 builds on Atmos, confirmed that this issue has resolved.

yadongxuEPA commented 1 year ago

Retested VERDI 20231012 builds on Atmos, confirmed that this issue has resolved.

yadongxuEPA commented 11 months ago

Checked VERDI_2.1.5_linux64_20231222.tar.gz on Atmos and it worked.

lizadams commented 11 months ago

Testing using VERDI_2.1.5_mac_20240103.tar.gz

using command line option: fails to recognize -project

./verdi.command -project "~/test_project" 2024.01.04 18:20:36.350 [main] ERROR anl.verdi.commandline.ScriptHandler - -project is not a valid command. Skipping this command...

But the verdi.sh -help command documentation says it is:

./verdi.command -help [ -project ""]

Using the VERDI GUI - I was able to load the project and verify that the dataset and the variable was loaded.

yadongxuEPA commented 11 months ago

Checked VERDI_2.1.5_linux64_20240103.tar.gz on Atmos with command line, got the same error as below: image

yadongxuEPA commented 11 months ago

Additional re-test also done on VERDI_2.1.4_linux64_20231013.tar.gz (before Java update) on Atmos with command line, got the same error as below: image

lizadams commented 10 months ago

Verified by creating a new saved project that saved the filename and variable O3

cat ~/o3_CCTM46_save_project

Output

<project>
  <datasetElements>
    <dataset.element>
      <timeMin>0</timeMin>
      <timeMax>24</timeMax>
      <layerMin>0</layerMin>
      <layerMax>2</layerMax>
      <timeUsed>false</timeUsed>
      <layerUsed>false</layerUsed>
      <datasetURL>file:/Users/lizadams/Downloads/VERDI_2.1.5_01_24/plugins/bootstrap/../../data/model/CCTM46_P16.baseO2a.36k.O3MAX</datasetURL>
      <alias>[1]</alias>
      <urlIndex>1</urlIndex>
    </dataset.element>
  </datasetElements>
  <formulaElements>
    <formula.element>
      <timeMin>0</timeMin>
      <timeMax>24</timeMax>
      <layerMin>-1</layerMin>
      <layerMax>0</layerMax>
      <timeUsed>false</timeUsed>
      <layerUsed>false</layerUsed>
      <formula>O3[1]</formula>
    </formula.element>
  </formulaElements>

Note, that the project file contains the path to the file and filename, and the formula name.

Verified that you could load the project and find the filename and formula name in the gui after loading.

Using VERDI_2.1.5_mac_20240124.tar.gz

[vcredadmins-MacBook-Pro:~/downloads/VERDI_2.1.5_01_24] lizadams%

cd /Users/lizadams/downloads/VERDI_2.1.5_01_24
./verdi.command -project ~/o3_CCTM46_save_project

This was successful. It loaded the project.

yadongxuEPA commented 10 months ago

Checked VERDI_2.1.5_linux64_20240124.tar.gz on Atmos and confirmed that the command line issue has resolved.