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
netcdf4:init at 1.5.1.2 #67338
netcdf4:init at 1.5.1.2 #67338
Conversation
Looks good to me (overall), I'll give it a try when possible (it might take time). Did you try to see if the tests can be re-enabled? |
The commits should be renamed:
I would also say that your second commit (introducing |
inherit mpi; | ||
}; | ||
meta = with stdenv.lib; { | ||
description = "Interface to netCDF library (versions 3 and 4) with support for parallel IO"; |
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.
I do not think the description should change from the previous implementation.
And by the way, thanks for your first PR to |
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.
Please undo the indentation change that is not needed.
version = "1.5.1.2"; | ||
, numpy, zlib, netcdf, hdf5, curl, libjpeg, cython, cftime | ||
,mpi4py ? null, openssh ? null}: | ||
assert (mpi4py!= null) -> |
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.
assert (mpi4py!= null) -> | |
assert (mpi4py != null) -> |
|
||
disabled = isPyPy; | ||
let | ||
mpiSupport = (mpi4py!=null); |
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.
mpiSupport = (mpi4py!=null); | |
mpiSupport = (mpi4py != null); |
@mamueller Are you interested in finishing this? |
What would have to be done?
Am Fr., 27. Dez. 2019 um 22:27 Uhr schrieb Dmitry Kalinkin <
notifications@github.com>:
… @mamueller <https://github.com/mamueller> Are you interested in finishing
this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67338?email_source=notifications&email_token=AAIRGPPAGBP2X6IYY27ADRTQ2ZXLXA5CNFSM4IO7CKDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHXZFCQ#issuecomment-569348746>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIRGPN4UL5KECRHVS55R7DQ2ZXLXANCNFSM4IO7CKDA>
.
|
@mamueller You need to rebase your changes on top of our master branch to fix the merge conflict. Since we already updated to version 1.5.3, you should not need your parallel4Detection.patch anymore [1]. Also, you would need to address the review comments above. |
I am a little under pressure just now. So I would not mind if I would not
have to do it right now.
(At the moment I am not working on any nix related stuff, so its a bit
awkward to sell to my boss, while when I made the change we really needed
it ...)
Am Di., 31. Dez. 2019 um 18:55 Uhr schrieb Dmitry Kalinkin <
notifications@github.com>:
… @mamueller <https://github.com/mamueller> You need to rebase your changes
on top of our master branch to fix the merge conflict. Since we already
updated to version 1.5.3, you should not need your parallel4Detection.patch
anymore [1]. Also, you would need to address the review comments above.
***@***.***
<Unidata/netcdf4-python@43ba3e5>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#67338?email_source=notifications&email_token=AAIRGPN7JJIN7BJZWIMHJDTQ3OBQ3A5CNFSM4IO7CKDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH4P6JA#issuecomment-569966372>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIRGPMD5LUQ4MNHPDWM3GLQ3OBQ3ANCNFSM4IO7CKDA>
.
|
Sorry for the late response. |
Now also the tests run except one that is skipped by the patch. The behavior of the tests is puzzeling to me in two ways: 1. If I drop into nix-shell (even with --pure ) and call genericBuild all tests run but if I use nix-build the test fails. (If you look at the test you see that it tries to load a remote url. I have no clue why this works in the shell and not in nix-build) 2. A similar thing happens with py.test: It works in the nix-shell but fails with nix-build but here the test suite does not even start. I used unittest instead which leads to only one test failing (which is now skipped by the patch)
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
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.
@mamueller Yes there are a few things you missed from previous review. This is looking better (style-wise), but there are still few rough edges to fix. Please see my comments below.
|
||
checkInputs = [ pytest ]; | ||
#patches=[./skipDapTest.patch]; |
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.
Please remove this.
HDF5_DIR= lib.getDev hdf5; | ||
NETCDF4_DIR="${netcdf}"; | ||
CURL_DIR="${curl.dev}"; | ||
JPEG_DIR="${libjpeg.dev}"; |
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.
Changes to these four lines are not needed.
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.
Thanks for your time. I learned a bit about nix (I can now use inherit properly ;-) and also see the point of lib.optionals..)
I have committed all the suggestions and added the remaining outdated ones manually.
I have some remaining questions:
- I am sorry for having created such a lot of style problems.
Is there a linter (or at least a style guide)?
I am using vim with vim-nix
For python code I use the python language server integration which is very verbose
Is there something similar available for nix? - I am a bit unsure about the workflow used to deal with pull requests.
( I normally work in a very small group at a research institute where 99.999 % of git usage consists of pull and push and even branches are an exception..., so we are not very professional users..)
I know what rebasing means and did it twice already for this branch, but I do not know for instance if you would prefer my (many tiny) commits to be squashed into one or if I would make things harder by it...)
So any suggestions about using git professionally are also welcome.
Thanks again.
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.
@mamueller
Regarding your questions:
-
There are couple linters that could help.
nixpkgs-fmt
is one of the most promising ones. There are several other ones: https://github.com/nix-community/nixpkgs-fmt#formatters
Note that if will format whole file at the time, which may hinder the review process if you mix functional changes with style changes. A typical solution to that is to format the original file in a first commit and then introduce functional changes in subsequent separate commits. It is a bit too late to do that in this PR, but you could try this in the future. -
Usually commits are supposed to have one specific idea for a change that is well described in the commit message. So if a PR contains several separate changes, we usually ask for them to be in separate commits. In case of this PR there is only one change (adding mpi support to pythonPackages.netcdf4), so we might just squash everything on merge for you. If you are unsure what to do, look around at other peoples contributions, see what they do.
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
py.test test/tst_*.py | ||
cd test | ||
rm tst_dap.py # does not fail in the nix-shell | ||
python -m unittest tst_*.py |
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.
${python.interpreter}
instead of python
. This is a prerequisite for supporting non-CPython interpreters such as PyPy.
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.
Noticed there were couple whitespace issues. Also, reposting some previous comments that were not addressed.
buildPythonPackage rec { | ||
pname = "netCDF4"; | ||
version = "1.5.3"; | ||
|
||
disabled = isPyPy; | ||
|
||
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.
This change is not needed
|
||
buildInputs = [ | ||
cython | ||
mpi |
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.
mpi | |
mpi |
]; | ||
] ++ lib.optionals mpiSupport [mpi4py mpi openssh]; | ||
|
||
#patches=[./skipDapTest.patch]; |
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.
Please remove this
NETCDF4_DIR=netcdf; | ||
CURL_DIR=curl.dev; | ||
JPEG_DIR=libjpeg.dev; | ||
NETCDF4_DIR="${netcdf}"; |
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.
NETCDF4_DIR="${netcdf}"; | |
NETCDF4_DIR=netcdf; |
CURL_DIR=curl.dev; | ||
JPEG_DIR=libjpeg.dev; | ||
NETCDF4_DIR="${netcdf}"; | ||
CURL_DIR="${curl.dev}"; |
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.
CURL_DIR="${curl.dev}"; | |
CURL_DIR=curl.dev; |
JPEG_DIR=libjpeg.dev; | ||
NETCDF4_DIR="${netcdf}"; | ||
CURL_DIR="${curl.dev}"; | ||
JPEG_DIR="${libjpeg.dev}"; |
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.
JPEG_DIR="${libjpeg.dev}"; | |
JPEG_DIR=libjpeg.dev; |
closes #67340. |
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.
assuming other reviews are addressed
https://github.com/NixOS/nixpkgs/pull/67338
1 package built:
netcdffortran-mpi
cc @bhipple for mpi conventions
netcdffortran-mpi = appendToName "mpi" (netcdffortran.override { | ||
hdf5 = hdf5-mpi; | ||
netcdf = netcdf-mpi; | ||
}); |
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.
We haven't done anything with mpi
, but the direction we went with blas/lapack was to have 1 variable at the top level specifying your variant, and then an overlay can -- in one place -- consistently override everything to be the right flavor.
This ensures you don't end up with two incoherent flavors of something like numpy in your stack. CC @matthewbauer not sure if we should do something similar for mpi
.
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.
ah, i did get them mixed up. But I think we should have similar conventions between blas and mpi.
I marked this as stale due to inactivity. → More info |
I marked this as stale due to inactivity. → More info |
#67337
Generalized the expression to be able to create a version with parallel
IO. If the function is called with netcdf-mpi, hdf5-mpi and mpi4py
it now produces a version that can access netcdf4 files in parallel.
I tested this with a small python script that uses parallel IO.
This should probably go to the original testsuite of the package which
is disabled in the nix expression I started with.
So I did not touch this part.
The patch is necessary since the original setup.py does not find
the parallel version of the netcdf although it is there since it
inspects the header file with a pattern that is propably only present in
the newest version. I made a pullrequest to the upstream maintainers to
generelize the pattern so that the patch will no longer be needed.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @