Describe the bug
The function normalization.irradiance_rescale(method='iterative') uses a global variable filt to rescale the modeled irradiance and match with measured irradiance on clear days. This causes problems with parallel computing, since multiple threads share the same global variable filt. Hence, multiple threads will compete between defining and reading filt. This is not the intended behavior since every thread should have it's own variable filt for the computation.
Full error message and traceback
IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match)
To Reproduce
The bug can only be detected when the length of the irradiance of currently executed parallel computation differ from each other. This will depend on the number of parallel processes and the inverter data that are analyzed. Typically, this bug can be detected by starting a fleets_analysis run performing a clearsky analysis on one system with multiple inverters and changing the number of workers (CPUs). The occurrence of the error message will vary between runs with different CPUs.
Expected behavior
The expected behavior is that filt always matches the length of the input irradiance data series. Individual parallel threads should not share the variable filt.
Additional context
To resolve that issue, the variable filt needs to be local instead of global in _single_rescale().
Describe the bug The function
normalization.irradiance_rescale(method='iterative')
uses a global variablefilt
to rescale the modeled irradiance and match with measured irradiance on clear days. This causes problems with parallel computing, since multiple threads share the same global variablefilt
. Hence, multiple threads will compete between defining and readingfilt
. This is not the intended behavior since every thread should have it's own variablefilt
for the computation.Full error message and traceback IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match)
To Reproduce The bug can only be detected when the length of the irradiance of currently executed parallel computation differ from each other. This will depend on the number of parallel processes and the inverter data that are analyzed. Typically, this bug can be detected by starting a
fleets_analysis
run performing a clearsky analysis on one system with multiple inverters and changing the number of workers (CPUs). The occurrence of the error message will vary between runs with different CPUs.Expected behavior The expected behavior is that
filt
always matches the length of the input irradiance data series. Individual parallel threads should not share the variablefilt
.Additional context To resolve that issue, the variable
filt
needs to be local instead of global in_single_rescale()
.