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

[minor suggestion] optional importing of datasets? #365

Open
bluenote10 opened this issue Jun 26, 2019 · 3 comments
Open

[minor suggestion] optional importing of datasets? #365

bluenote10 opened this issue Jun 26, 2019 · 3 comments
Labels

Comments

@bluenote10
Copy link
Contributor

import arraymancer was just broken for me due to an issue with my local untar version. I got curious why Arraymancer actually needs this and noticed that the default import builds things like imdb and mnist.

Maybe the included test datasets could be omitted from the default import to make default builds more slim?

@mratsim
Copy link
Owner

mratsim commented Jun 27, 2019

Yes, agreed.

I'm not too sure how I can do CI on optional dependencies though, it would need nimble support nim-lang/nimble#482.

For example HDF5 support is optional but due to this it's not tested :/.

template canImport(x: untyped): bool =
compiles:
import x
import ./io_csv, ./io_npy, ./io_image
export io_csv, io_npy, io_image
when canImport(nimhdf5):
# only provide the hdf5 interface, if the hdf5 library is
# installed to avoid making `nimhdf5` a dependency
import ./io_hdf5
export io_hdf5

@mratsim mratsim added the build label Jun 27, 2019
@bluenote10
Copy link
Contributor Author

I'm not too sure how I can do CI on optional dependencies though

I think as a first step keeping them as nimble dependencies is fine. What would already help is to move the import into individual tests instead of letting import arraymancer lead to importing imdb/mnist.

@Vindaar
Copy link
Collaborator

Vindaar commented Jun 27, 2019

Aside from the fact that HDF5 support is not being tested, the canImport solution has its downsides too. Since I obviously have nimhdf5 installed, every time I import arraymancer, I get a nice dependency on HDF5, even though the project itself might not want to touch HDF5 at all.

In my own projects I added an optional compiler flag -d:pure if I want to avoid importing such modules. But that's also not a perfect solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants