openghg / openghg_inversions

University of Bristol Atmospheric Chemistry Research Group RHIME Inversion code (with openghg dependency)
MIT License
5 stars 0 forks source link

Offset PDF - PyMC Shape Error #200

Closed hdelongueville closed 2 months ago

hdelongueville commented 2 months ago

When using add_offset = True with offsetprior = {"pdf":"normal", "mu":0., "sigma":0.6}, I get the PyMC Error below.

Traceback (most recent call last): File "/user/home/qq24644/openghg_inversions/openghg_inversions/hbmcmc/run_hbmcmc.py", line 233, in mcmc_function(param) File "/user/home/qq24644/openghg_inversions/openghg_inversions/hbmcmc/hbmcmc.py", line 536, in fixedbasisMCMC mcmc_results = mcmc.inferpymc(mcmc_args) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/openghg_inversions/openghg_inversions/hbmcmc/inversion_pymc.py", line 293, in inferpymc offset = parse_prior("offset", offsetprior, shape=nsites - 1) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/openghg_inversions/openghg_inversions/hbmcmc/inversion_pymc.py", line 107, in parse_prior return dist(name, params, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/.conda/envs/openghg_inv/lib/python3.12/site-packages/pymc/distributions/distribution.py", line 555, in new rv_out = cls.dist(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/.conda/envs/openghg_inv/lib/python3.12/site-packages/pymc/distributions/continuous.py", line 511, in dist return super().dist([mu, sigma], kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/.conda/envs/openghg_inv/lib/python3.12/site-packages/pymc/distributions/distribution.py", line 627, in dist shape = convert_shape(shape) ^^^^^^^^^^^^^^^^^^^^ File "/user/home/qq24644/.conda/envs/openghg_inv/lib/python3.12/site-packages/pymc/distributions/shape_utils.py", line 215, in convert_shape raise ValueError( ValueError: The shape parameter must be a tuple, TensorVariable, int or list. Actual: <class 'numpy.int64'>