GithubHelp home page GithubHelp logo

h5py warning about openfermion HOT 29 CLOSED

gaming-hacker avatar gaming-hacker commented on July 20, 2024 1
h5py warning

from openfermion.

Comments (29)

kevinsung avatar kevinsung commented on July 20, 2024 1

The output you got is correct.

This is the same warning that I mentioned getting with Python2.7 in #173 . My details are

Arch Linux with kernel version 4.14.11
Python 2.7.14
numpy 1.14.0
scipy 1.0.0
h5py 2.7.1

I also get the warning when simply running import openfermion. From the look of it, it seems specific to h5py and is not our fault. It also seems like it shouldn't actually affect anything.

from openfermion.

Manjunathsai7 avatar Manjunathsai7 commented on July 20, 2024 1

pip3 uninstall h5py
pip3 install h5py==2.8.0rc1
this can fix problems . hope it will help you.

from openfermion.

babbush avatar babbush commented on July 20, 2024

This seems to have come up very recently. It is just a warning, not a bug, and the code output still looks correct. This is likely due to something that changed recently in one of our dependancies. I'll take a look briefly tonight but may need to return to this tomorrow or Saturday - it doesn't seem critical (albeit ugly). Kudos to anyone else who tracks it down.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

I just found out that I get the same warning from simply executing import h5py. So I think this has nothing to do with OpenFermion.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

From looking at h5py/h5py#961, it appears that the h5py developers are aware of this issue and are currently working on a fix at h5py/h5py#926.

from openfermion.

babbush avatar babbush commented on July 20, 2024

Hmm, thanks Kevin. Unfortunately they haven't updated that PR in ten days. The funny thing though is that I cannot reproduce this error on my mac. @kevinsung @gaming-hacker What version of h5py are you running?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

I'm using h5py 2.7.1

from openfermion.

babbush avatar babbush commented on July 20, 2024

I see. I am using Anaconda python and their latest distribution only uses h5py 2.7.0 which seems to not have this problem. I guess we should just wait until h5py people get this fixed.

from openfermion.

gaming-hacker avatar gaming-hacker commented on July 20, 2024

i'm using h5py (2.7.1) which was installed via openfermion dependencies. should i close the issue? i'll throw it over to the h5py repo.

if you run
python -c 'import h5py; print(h5py.version.info)'.

it confirms it is a dependency bug

from openfermion.

babbush avatar babbush commented on July 20, 2024

Thanks! I think it might be helpful to leave the issue open just so people can see this easily if they encounter the warning. I have marked it as "not our fault". We can close whenever h5py fixes this.

from openfermion.

gaming-hacker avatar gaming-hacker commented on July 20, 2024

i forked it and pulled in a few PRs and now without the warning

gaming-hacker/h5py

=>pycheck h5py
Summary of the h5py configuration
---------------------------------
h5py    2.7.1.post0
HDF5    1.10.1
Python  2.7.14 (default, Sep 22 2017, 00:06:07) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)]
sys.platform    darwin
sys.maxsize     9223372036854775807
numpy   1.14.0

from openfermion.

babbush avatar babbush commented on July 20, 2024

Hmm, so the problem disappeared for you? Does this mean the h5py people fixed the issue?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

I'm still getting the warning. I'm still on version 2.7.1 though and can't seem to get 2.7.1.post0.

from openfermion.

gaming-hacker avatar gaming-hacker commented on July 20, 2024

h5py haven't merged the PRs to fix this issue into their master branch. i forked my own repo, applied the correct PRs and now it works.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Cool. It looks like we just need to wait for them to release the next version, then we can close this issue.

from openfermion.

babbush avatar babbush commented on July 20, 2024

Are people still seeing this bug?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

I'm still getting the warning. The latest version of h5py on pip is still 2.7.1.

from openfermion.

babbush avatar babbush commented on July 20, 2024

Still?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Yeah. This will be an issue at least until the next h5py version (after 2.7.1) is released on pip (https://pypi.python.org/pypi/h5py). Again, this has nothing to do with OpenFermion because I get the warning when I execute just import h5py.

from openfermion.

babbush avatar babbush commented on July 20, 2024

A hacky way to suppress this from the issue on the h5py repo (where I recently complained):
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import h5py
warnings.resetwarnings()

Maybe it's better than always seeing this message? @kevinsung what do you think?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Thanks, that will be helpful for suppressing the warning in Jupyter notebook demos. I'm not sure that should actually go into our codebase though.

There is a new release candidate at https://pypi.python.org/pypi/h5py so hopefully this issue will be resolved soon!

from openfermion.

babbush avatar babbush commented on July 20, 2024

People still getting this? I like to check every week or so, lol

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Yup

from openfermion.

chenDeChao0808 avatar chenDeChao0808 commented on July 20, 2024

still
solutions?

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

The only real solution is to fix h5py, and by that I mean wait for the next production release to come out on https://pypi.python.org/pypi/h5py. @babbush gave a way to suppress the warning above:

import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import h5py
warnings.resetwarnings()

For instance, you can put that in your IPython configuration file and then the warning will not show up in Jupyter.

from openfermion.

gaming-hacker avatar gaming-hacker commented on July 20, 2024

i don't think you want to hack to disable the warnings, you're applying a bandaid that might break future builds or cause weird errors. i'd suggest let h5py fix their issue. or just fork your own repo and add it to this project as a submodule and apply the patches.

from openfermion.

aragilar avatar aragilar commented on July 20, 2024

@kevinsung The 2.8 release is now on PyPI, so you should be able to close this now.

from openfermion.

kevinsung avatar kevinsung commented on July 20, 2024

Great!

from openfermion.

babbush avatar babbush commented on July 20, 2024

I'm reopening because I still incur the error message on a fresh install of OpenFermion. I think we may need to bump the version requirement in requirements.txt for h5py.

from openfermion.

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.