Comments (7)
Are you working on a OS X app? We ran into this same problem and I suspect the warnings you get when you launch are the root cause:
Class SwiftObject is implemented in both .../libswiftCore.dylib and .../MyApp. One of the two will be used. Which one is undefined.
Looks like it's loading two versions of the swift standard lib. The only way to resolve it was to use Dataset.select()
and readDouble()
instead of the subscript helpers. At least until they fix these Swift issues.
from hdf5kit.
Thanks. Yes, it's an OS X command-line app. From what you say, it seems like avoiding swiftcore references means avoiding the two version loading issues. I have tried a few alternative ideas but unfortunately none successful. I have also hit http://www.openradar.me/23551273
which is what is causing the Xcode crashes.
We should probably keep this issue open until there's a resolution for the double library loading.
from hdf5kit.
This commit should fix this: 954561f
Also let me know what you think of that new approach.
from hdf5kit.
I've had the swift-build
branch working fine on OS X with the Swift 2.2-dev snapshot that Apple released. The only slight quirk is that there is a import CHDF5
required but that's no biggie.
Were you planning on merging that branch into master
or bringing these changes to the build branch?
from hdf5kit.
I haven't figured out hot to support iOS from swift-build, so I'll leave that in a branch until that's resolved. Merged latest changes into swift-build.
from hdf5kit.
The changes are an improvement I think to the prior methods and it all builds and works for me on swift-2.2-dev.
let dataset = file.openFloatDataset(nodeName)
is better than let dataset = file.openDataset(nodeName, type: Float.self)
and of course eliminates the cast required from Any
to [Float]
on the dataset read (which is a good thing!). The ultimate ideal of course would be just let ds = file.openDataset(nodeName)
or even better let ds = file["nodeName"]
. IMO the latter enforces the concept that an HDF5 file is essentially a dictionary containing datasets.
With swift-2.2-dev, data.read()
now produces an ..is not marked with try
issue but that doesn't concern me as I think that we should point people towards using subscript access rather than calling data.read()
. So it would be nice to have support for let foo = dataset[]
rather than let foo = dataset[0..]
My experience with scientist/progammers is that they know what the HDF5 names are that they want and they have a sense of what the data type is, and most of the time, they just want to get all the data in memory.
There is a long term issue with supporting complex HDF5 types i.e. tuples containing strings and decimals but IMHO those datasets are pretty few and far between.
Lastly, this all works for me so I have no problem with closing the issue.
from hdf5kit.
I added throws
because I think it makes more sense than silently failing. subscript
doesn't support that but I think it's good to have a way of not having to deal with the throws. I agree with reading via dataset[]
, I'll add that.
👍
from hdf5kit.
Related Issues (20)
- swiftc 2.2-dev has AnyObject problems on Linux HOT 1
- Problem reading columns within a group's dataset HOT 1
- Assertion fails in 32-bit architectures
- Port to Swift 3.0 HOT 8
- Add support for attributes HOT 1
- How to get the attributes and its name for each File instance? HOT 5
- StringAttribute.read() only returns 11 characters HOT 5
- Add support for shape property in dataset and support for read function that returns multi-dimensional array HOT 4
- readFixedLength() sometimes contains the corruption of text HOT 1
- error: product dependency 'HDF5Kit' not found HOT 4
- Cocoapods + -Os Optimization may cause crash? HOT 11
- Can't add package with Xcode 11 beta 3 on macOS Catalina beta 3
- Problem reading string attribute HOT 11
- Read in Array[3] of 64-bit floating point attribute
- Read hrtf.soap file
- Support for Swift 5
- write and read functions should take pointers HOT 1
- Add support for expanding datasets HOT 1
- Add support for hyper slabs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hdf5kit.