Skip to content

Fix c_month() ignoring its input (always returned all-zeros)#8

Open
mklarmann wants to merge 1 commit into
agroscope-ch:mainfrom
mklarmann:fix/c-month-ignores-input
Open

Fix c_month() ignoring its input (always returned all-zeros)#8
mklarmann wants to merge 1 commit into
agroscope-ch:mainfrom
mklarmann:fix/c-month-ignores-input

Conversation

@mklarmann

Copy link
Copy Markdown

c_month() initialised m_month to np.zeros and then tested m_month[i] (the zeros it had just created) instead of the input months, so no branch ever fired and the function returned an all-zeros array regardless of its argument — silently disabling the tillage month-correction. This seeds m_month from in_month so the Dec/Jan → February remapping operates on the real event months.

Fixes #3

c_month() initialised m_month to np.zeros and then tested m_month[i] (the zeros
it had just created) instead of the input months, so no branch ever fired and
the function returned an all-zeros array regardless of its argument — silently
disabling the tillage month-correction. Seed m_month from in_month so the Dec/Jan
-> February remapping operates on the real event months.

Fixes agroscope-ch#3
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 this pull request may close these issues.

c_month() tests the zeros it just created instead of its input, always returning all-zeros (SALCAnitrate_field.py:75-86)

1 participant