GithubHelp home page GithubHelp logo

Comments (7)

alejandro-isaza avatar alejandro-isaza commented on August 23, 2024

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.

timburgess avatar timburgess commented on August 23, 2024

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.

alejandro-isaza avatar alejandro-isaza commented on August 23, 2024

This commit should fix this: 954561f

Also let me know what you think of that new approach.

from hdf5kit.

timburgess avatar timburgess commented on August 23, 2024

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.

alejandro-isaza avatar alejandro-isaza commented on August 23, 2024

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.

timburgess avatar timburgess commented on August 23, 2024

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.

alejandro-isaza avatar alejandro-isaza commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.