diff --git a/docs/sphinx/source/changelog.rst b/docs/sphinx/source/changelog.rst index d29155dc..8b5fe59f 100644 --- a/docs/sphinx/source/changelog.rst +++ b/docs/sphinx/source/changelog.rst @@ -1,5 +1,6 @@ RdTools Change Log ================== +.. include:: changelog/v2.1.8.rst .. include:: changelog/v2.1.7.rst .. include:: changelog/v2.1.6.rst .. include:: changelog/v2.1.5.rst diff --git a/docs/sphinx/source/changelog/v2.1.8.rst b/docs/sphinx/source/changelog/v2.1.8.rst new file mode 100644 index 00000000..ca9b663a --- /dev/null +++ b/docs/sphinx/source/changelog/v2.1.8.rst @@ -0,0 +1,11 @@ +************************** +v2.1.8 (November 17, 2023) +************************** + +Bug fixes +--------- +* Fix a bug in parallel computing environments (:issue:`388` :pull:`399`) + +Contributors +------------ +* Martin Springer (:ghuser:`martin-springer`) \ No newline at end of file diff --git a/rdtools/normalization.py b/rdtools/normalization.py index df082100..8629c237 100644 --- a/rdtools/normalization.py +++ b/rdtools/normalization.py @@ -380,7 +380,7 @@ def irradiance_rescale(irrad, irrad_sim, max_iterations=100, ''' if method == 'iterative': - def _rmse(fact): + def _rmse(fact, filt): """ Calculates RMSE with a given rescale fact(or) according to global filt(er) @@ -392,10 +392,9 @@ def _rmse(fact): def _single_rescale(irrad, irrad_sim, guess): "Optimizes rescale factor once" - global filt csi = irrad / (guess * irrad_sim) # clear sky index filt = (csi >= 0.8) & (csi <= 1.2) & (irrad > 200) - min_result = minimize(_rmse, guess, method='Nelder-Mead') + min_result = minimize(_rmse, guess, (filt), method='Nelder-Mead') factor = min_result['x'][0] return factor