NOC-MSM / pyBDY

pyBDY: a Python based regional NEMO model configuration toolbox.
GNU General Public License v3.0
7 stars 7 forks source link

Error using PyNEMO: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2) and requested shape (0,2) #94

Open amrtalaat4 opened 2 years ago

amrtalaat4 commented 2 years ago

I've installed and activated the PyNEMO package successfully as in https://github.com/NOC-MSM/PyNEMO:

However, while I am following the tutorial to re-create the coordinates.bdy.ncfile using this command:

pynemo -s /path_to_file/PyNEMO/inputs/namelist_local.bdy

I get the following error:

File "/work/oda/as27121/pynemo_envs/pynemo/lib/python3.9/site-packages/numpy/lib/stride_tricks.py", line 348, in _broadcast_to
    it = np.nditer(
ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2)  and requested shape (0,2)

Note: I've created the PyNEMO environment using the pynemo_39.yml file.

jdha commented 2 years ago

sorry @amrtalaat4 I've been on leave ... I'll have a look in the coming days and get back to you

nickheavens-cgg commented 1 year ago

Hi, I've run into the same issue. The full error is:

Didn't find a proxy environment variable Traceback (most recent call last): File "/home/nheavens/.conda/envs/pynemo/bin/pynemo", line 33, in sys.exit(load_entry_point('pynemo==0.1.0', 'console_scripts', 'pynemo')()) File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/pynemo-0.1.0-py3.9.egg/pynemo/pynemo_exe.py", line 46, in main cProfile.runctx("f(x, y)",{'f': profiler.process_bdy, 'x': setup_file, 'y': mask_gui}, {}, 'pynemo_stats') File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/cProfile.py", line 19, in runctx return _pyprofile._Utils(Profile).runctx(statement, globals, locals, File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/profile.py", line 62, in runctx prof.runctx(statement, globals, locals) File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/cProfile.py", line 100, in runctx exec(cmd, globals, locals) File "", line 1, in File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/pynemo-0.1.0-py3.9.egg/pynemo/profiler.py", line 109, in process_bdy bdy_ind[grd] = gen_grid.Boundary(bdy_msk, settings, grd) File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/pynemo-0.1.0-py3.9.egg/pynemo/nemo_bdy_gen_c.py", line 77, in init msk = np.pad(bdy_msk,((1,1),(1,1)), 'constant', constant_values=(-1)) File "<__array_function__ internals>", line 200, in pad File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/numpy/lib/arraypad.py", line 744, in pad pad_width = _as_pairs(pad_width, array.ndim, as_index=True) File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/numpy/lib/arraypad.py", line 518, in _as_pairs return np.broadcast_to(x, (ndim, 2)).tolist() File "<__array_function__ internals>", line 200, in broadcast_to File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/numpy/lib/stride_tricks.py", line 413, in broadcast_to return _broadcast_to(array, shape, subok=subok, readonly=True) File "/home/nheavens/.conda/envs/pynemo/lib/python3.9/site-packages/numpy/lib/stride_tricks.py", line 349, in _broadcast_to it = np.nditer( ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (2,2) and requested shape (0,2)

nickheavens-cgg commented 1 year ago

OK, this is not a bug. The issue is that the benchmark files are needed to run. If they can't be accessed, the program provides this error.

jdha commented 1 year ago

Apologies - writing some useful Error Messages into the code is on the to-do-list!