Skip to content

35 handle null values#15

Open
aadityaamehrotra17 wants to merge 5 commits into
developmentfrom
35-handle-null-values
Open

35 handle null values#15
aadityaamehrotra17 wants to merge 5 commits into
developmentfrom
35-handle-null-values

Conversation

@aadityaamehrotra17

@aadityaamehrotra17 aadityaamehrotra17 commented Sep 30, 2025

Copy link
Copy Markdown
Member
  1. Manually specifying fill values is now possible. This can be done using the fill_values dict in get_constants().
  2. If fill value is specified during variable creation as an attribute (using fill_value = X), the output data array doesn't seem to make use of this fill value. NCView interprets it as 0.
  3. For the PMFINE group, just one fill value is specified for all species. Similarly, for NOX, one value is used for both NO and NO2

@aadityaamehrotra17 aadityaamehrotra17 linked an issue Sep 30, 2025 that may be closed by this pull request

@douglowe douglowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens to the fill value if we apply the multiplying_factor after we replace NaN's / Nulls with the fill value? Does the fill value remain the same, or is it modified by the multiplying factor?

@douglowe

Copy link
Copy Markdown
Member

I think it's probably safer to add the fill value after all the maths operations have been carried out.

@aadityaamehrotra17

aadityaamehrotra17 commented Sep 30, 2025

Copy link
Copy Markdown
Member Author

What happens to the fill value if we apply the multiplying_factor after we replace NaN's / Nulls with the fill value? Does the fill value remain the same, or is it modified by the multiplying factor?

According to me:

Fill Value first, maths later:
[None] -> [10] # fill value
[10] * 3 -> [30] # modified
Here * 3 was the maths op, so clearly fill value changes/gets treated as a normal value

Fill Value later, maths first:
[None] * 3 -> TYPEERROR?
Here * 3 was the maths op

(The error can be avoided with NAN, but there is a risk of propagation)

@aadityaamehrotra17

Copy link
Copy Markdown
Member Author

With reference to this commit:
I have added the fill_value attribute for variables to show up in metadata. This is different from the actual _FillValue attribute, which can only be added during variable creation.

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.

Handle Null Values

2 participants