olmozavala / particleviz

Software to generate visualizations of large number of particles from Lagrangian output.
MIT License
10 stars 6 forks source link

Problems with Initializing webapp #9

Closed ChanJeunlam closed 2 years ago

ChanJeunlam commented 2 years ago

I have successfully cloned the repository and created the environment. But when I tried to run the code at the first time using the example file like this

python ParticleViz.py --input_file ExampleData/Global_Marine_Debris.nc

It didnot work and the error information is listed as below. Could you please help me figure out how to solve the problem?

{'--config_file': False,
 '--help': False,
 '--input_file': True,
 '--version': False,
 '<config_file>': None,
 '<input_file>': 'ExampleData/Global_Marine_Debris.nc',
 'all': False,
 'preproc': False,
 'webapp': False}
Doing preprocessing...
Reading data...
Total number of timesteps: 62 Total number of particles: 32300 (2002600 positions, Number of files: 2)
----- Variables Inside file ----
time
trajectory
lat
lon
z
Working with file 0...
 Saving binary file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/2.....
 Saving zip file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/2/pviz_dataset 1_00.zip ( Time steps from 0 to 50) .....
Working with file 1...
 Saving binary file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/2.....
 Saving zip file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/2/pviz_dataset 1_01.zip ( Time steps from 50 to 62) .....
Working with file 0...
 Saving binary file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/4.....
 Saving zip file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/4/pviz_dataset 1_00.zip ( Time steps from 0 to 50) .....
Working with file 1...
 Saving binary file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/4.....
 Saving zip file C:\Users\hugo\particleviz\ParticleViz_DataPreproc\..\ParticleViz_WebApp\data/4/pviz_dataset 1_01.zip ( Time steps from 50 to 62) .....
Done!
Initializing webapp...
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\hugo\particleviz/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\hugo\particleviz\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\hugo\AppData\Local\npm-cache\_logs\2022-04-01T06_26_19_443Z-debug-0.log

> particleviz@0.0.1 start
> npm run copy-config & react-scripts start

> particleviz@0.0.1 copy-config
> cpx './data/**/*.{txt,bin,zip,json}' ./public --watch

'cpx' is not recognized as an internal or external command,
operable program or batch file.
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
Done!
philippemiron commented 2 years ago

I can take a look with a Windows VM over the weekend. The package.json file is in the ParticleViz_WebApp/ folder, so I'm not sure why it's trying to find it in the main path. Can you try running it from another folder, putting the full PATH to ParticleViz.py and the input_file?

ChanJeunlam commented 2 years ago

Thank you for the suggestion, I still do not know why it find package.json file in the main path so I just copy package.json file from ./ParticleViz_WebApp subfolder and add it to main path and now it works a little bit. I am too new to understand the full function of the package. Maybe not having init.py in the moduel of ParticleViz_WebApp?

philippemiron commented 2 years ago

Executing this command from the particleviz environment should:

  1. Perform the preprocessing operation and store everything to /ParticleViz_WebApp/data/.
  2. Retrieve the package.json in ParticleViz_WebApp/ and install all the dependencies to the ParticleViz_WebApp/node_modules/ folder, if it doesn't exist. You can delete node_modules/ folder to reinitiallized the process.
  3. Launch a web server, open the browser at http://localhost:3000/ with the interface presenting the test dataset.
ChanJeunlam commented 2 years ago

I think I was stuck at the stage of initialing the webapp

Initializing webapp...

> particleviz@0.0.1 start
> npm run copy-config & react-scripts start

> particleviz@0.0.1 copy-config C:\Users\hugo\particleviz\ParticleViz_WebApp
> cpx './data/**/*.{txt,bin,zip,json}' ./public --watch

My python/conda is installed directly in Windows. As for the first step, it works and produces the following file

C:\USERS\HUGO\PARTICLEVIZ\PARTICLEVIZ_WEBAPP\DATA
├─2
│      pviz_dataset 1_00.txt
│      pviz_dataset 1_00.zip
│      pviz_dataset 1_01.txt
│      pviz_dataset 1_01.zip
│      
└─4
        pviz_dataset 1_00.txt
        pviz_dataset 1_00.zip
        pviz_dataset 1_01.txt
        pviz_dataset 1_01.zip

As for the second step, it works and successfully produces the needed folder.

philippemiron commented 2 years ago

The script also hangs in my VM at cpx './data/**/*.{txt,bin,zip,json}' ./public --watch. I will need to investigate more.

ChanJeunlam commented 2 years ago

thanks, but I also donot know how to fit it

philippemiron commented 2 years ago

I managed to now run it fine on a Windows VM, let me know if you still have issues!

Cheers,