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
New initialisation method when passin a df.Field
using the new xarray functionality.
#135
Conversation
This is required to be able to have a implementation of as_array for df.Field without running into problems with circular imports.
@lang-m Happy to see that it is useful to the project! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good! Just added a few minor suggestions.
Is there a reason why we want all _as_array
in Field
class and not in dfu
?
@marijanbeg Could you please have a look at the last test failure. This is a problem with floating-point accuracy. My suggestion would be to slightly relax |
@lang-m, I agree. I am just not sure what is the right way of avoiding hard-coded tolerances. Maybe we could define some tolerances in |
@marijanbeg Do you think sticking to the default settings for |
The new |
Nice, I like that. |
@lang-m, default value for |
close to pmin or pmax
argparse.FileType cannot handle subsequent errors correctly. Therefore, output files were created even if the number of input and output files did not match. These files were not cleaned up automatically.
Codecov Report
@@ Coverage Diff @@
## master #135 +/- ##
==========================================
- Coverage 95.86% 95.82% -0.05%
==========================================
Files 20 20
Lines 2106 2108 +2
==========================================
+ Hits 2019 2020 +1
- Misses 87 88 +1
Continue to review full report at Codecov.
|
@marijanbeg Setting |
It does exactly what it says on the tin. |
if the provided field does not contain the region of the new field.
Test
mesh.n = (100, 100, 10)
mesh.n = (10, 10, 10)
and passing the old field tovalue
Performance improvement:
xarray
): ~ 5 ms@swapneelap This is probably the first use case for your new method.