Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle writing all-NA magclass objects in calcOutput #191

Closed
wants to merge 0 commits into from

Conversation

fbenke-pik
Copy link
Contributor

@fbenke-pik fbenke-pik commented Nov 10, 2023

For some aggregations and calc functions, we produce all-NA magclass objects (e.g. H12 for a dataset that only has values for DEU). In this case, write.report crashes during the conversion to a data table.

In this PR, calcOutput checks for all-NA magclass objects after regional aggregation and before trying to write to a mif and throws a warning for all-NAs.

@fbenke-pik
Copy link
Contributor Author

Alternatively, I could look into handling this directly in write.report, if that is the preferred approach.

@tscheypidi
Copy link
Member

yes, please do it in write.report itself as this seems more to be a bug in that function than an issue in madrat

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.

2 participants