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

Error in computing PET f"Invalid latitude value: {latitude_degrees} (must be " + #334

Closed
mmaoyi opened this issue Sep 7, 2019 · 4 comments · Fixed by #339
Closed

Error in computing PET f"Invalid latitude value: {latitude_degrees} (must be " + #334

mmaoyi opened this issue Sep 7, 2019 · 4 comments · Fixed by #339

Comments

@mmaoyi
Copy link

mmaoyi commented Sep 7, 2019

Hi James

I get the message below while I am trying to compute PET. Please help

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/mmaoyi/miniconda3/bin/process_climate_indices", line 10, in
sys.exit(main())
File "/home/mmaoyi/miniconda3/lib/python3.7/site-packages/climate_indices/main.py", line 1718, in main
kwargs
File "/home/mmaoyi/miniconda3/lib/python3.7/site-packages/climate_indices/main.py", line 1061, in _compute_write_index
args=args,
File "/home/mmaoyi/miniconda3/lib/python3.7/site-packages/climate_indices/main.py", line 1299, in _parallel_process
pool.map(_apply_along_axis_double, chunk_params)
File "/home/mmaoyi/miniconda3/lib/python3.7/multiprocessing/pool.py", line 268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/home/mmaoyi/miniconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
numba.errors.UnsupportedError: Failed in object mode pipeline (step: analyzing bytecode)
Use of unknown opcode 'FORMAT_VALUE'

File "../../../../../miniconda3/lib/python3.7/site-packages/climate_indices/indices.py", line 488:
def pet(temperature_celsius: np.ndarray,

else:
message = (f"Invalid latitude value: {latitude_degrees} (must be " +
^

Unsupported functionality was found in the code Numba was trying to compile.

If this functionality is important to you please file a feature request at:
https://github.com/numba/numba/issues/new

@monocongo
Copy link
Owner

I'm pretty sure this is related to this issue which prevents the usage of formatted strings within numba.jit annotated functions. It was partially addressed in issue #306 but apparently there are some other formatted strings that need to be replaced with old-fashioned formatted strings in order to work with numba.

monocongo added a commit that referenced this issue Sep 7, 2019
…d from numba issue #3250 (an unsupported formatting-related opcode); fixed the setup.py keywords entry to be a list instead of a tuple

#334
@monocongo
Copy link
Owner

OK, @mmaoyi, now please reinstall from the master branch and try again. The recent changes I made in PR #335 should fix this issue for you, if not please let me know.

@mmaoyi
Copy link
Author

mmaoyi commented Sep 7, 2019

Many thanks James. I am using the pypi version of the code and applied the fixes to the offending lines.

Kind regards

@An1you
Copy link

An1you commented May 13, 2023

OK, @mmaoyi, now please reinstall from the master branch and try again. The recent changes I made in PR #335 should fix this issue for you, if not please let me know.

Hi,James

I get the message below while I am trying to compute PET. Please help

Traceback (most recent call last):
File "scpdsi_CNRM.py", line 86, in
pet_his_g6[i,j,:] = indices.pet(temperature_celsius=tas_his_g6[i,j,:],
File "/public/home/tiancg/mysoft/anaconda3/envs/meteo/lib/python3.8/site-packages/numba/dispatcher.py", line 404, in _compile_for_args
error_rewrite(e, 'unsupported_error')
File "/public/home/tiancg/mysoft/anaconda3/envs/meteo/lib/python3.8/site-packages/numba/dispatcher.py", line 344, in error_rewrite
reraise(type(e), e, None)
File "/public/home/tiancg/mysoft/anaconda3/envs/meteo/lib/python3.8/site-packages/numba/six.py", line 668, in reraise
raise value.with_traceback(tb)
numba.errors.UnsupportedError: Failed in object mode pipeline (step: analyzing bytecode)
�[1mUse of unsupported opcode (FORMAT_VALUE) found
�[1m
File "../../../../tiancg/mysoft/anaconda3/envs/meteo/lib/python3.8/site-packages/climate_indices/indices.py", line 583:�[0m
�[1mdef pet(temperature_celsius: np.ndarray,

�[1m message = (f"Invalid latitude value: {latitude_degrees}" +
�[0m �[1m^�[0m�[0m
�[0m

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 a pull request may close this issue.

3 participants