Giter VIP home page Giter VIP logo

jeriek / xsec Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 0.0 160.29 MB

xsec is a tool for fast evaluation of cross-sections, taking advantage of the power and flexibility of Gaussian process regression.

Home Page: https://github.com/jeriek/xsec

License: GNU General Public License v3.0

Python 100.00%
high-energy-physics cross-sections gaussian-processes regression hep-ph supersymmetry bayesian

xsec's People

Contributors

ahye avatar anderkve avatar ingridavh avatar jeriek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

xsec's Issues

Error with pickles in Python 3

There seems to be a problem with using the pickled GPs in Python 3. I get the following error trying to run

Traceback (most recent call last):
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/bin/xsec-test", line 44, in <module>
    xsec.load_processes(processes)
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/lib/python3.7/site-packages/xsec/gploader.py", line 391, in load_processes
    process_xstype, energy
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/lib/python3.7/site-packages/xsec/gploader.py", line 324, in load_single_process
    gp_reco = reconstruct_gp(model_file)
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/lib/python3.7/site-packages/xsec/gploader.py", line 216, in reconstruct_gp
    gp_model = joblib.load(file_object)
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 575, in load
    obj = _unpickle(fobj)
  File "/Users/ahye/Projects/gambit/xsecs/smoking/pyenv3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 518, in _unpickle
    raise new_exc
ValueError: You may be trying to read with python 3 a joblib pickle generated with python 2. This feature is not supported by joblib.

setuptools + shebang issue

[@jeriek and I discussed this on email -- just registering an issue here to log it properly. Jeriek already has a fix ready.]

There seems to be a problem with shebang expansion and setuptools. Here's how I can reproduce it with a clean Python2.7 environment:

virtualenv myenvs27/xsec_test
source myenvs27/xsec_test/bin/activate
pip install xsec==1.0.1
xsec-download-gprocs -t gg

This produces a No such file or directory error because it is looking for the Python binary in the wrong path. (Looks like setuptools has expanded the shebang in the source code.)

Missing dill

[A second issue that @jeriek and I discussed via email. Just registering it here to log it properly. Jeriek has a fix ready.]

For Python3 there is an indirect dependency on the dill module, related to unpickling the trained GPs. Here's how to reproduce it from a clean Python3 environment:

python3 -m venv myenv3/xsec_test
source myenv3/xsec_test/bin/activate
pip install xsec==1.0.0
xsec-download-gprocs -t gg
xsec-test ./gprocs

This gives the following error:

    Traceback (most recent call last):
      File "/home/anders/myenv3/xsec_test/bin/xsec-test", line 44, in <module>
        xsec.load_processes(processes)
      File "/home/anders/myenv3/xsec_test/lib/python3.8/site-packages/xsec/gploader.py", line 390, in load_processes
        PROCESS_DICT[process_xstype] = load_single_process(
      File "/home/anders/myenv3/xsec_test/lib/python3.8/site-packages/xsec/gploader.py", line 324, in load_single_process
        gp_reco = reconstruct_gp(model_file)
      File "/home/anders/myenv3/xsec_test/lib/python3.8/site-packages/xsec/gploader.py", line 216, in reconstruct_gp
        gp_model = joblib.load(file_object)
      File "/home/anders/myenv3/xsec_test/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 575, in load
        obj = _unpickle(fobj)
      File "/home/anders/myenv3/xsec_test/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 504, in _unpickle
        obj = unpickler.load()
      File "/usr/lib/python3.8/pickle.py", line 1210, in load
        dispatch[key[0]](self)
      File "/usr/lib/python3.8/pickle.py", line 1526, in load_global
        klass = self.find_class(module, name)
      File "/usr/lib/python3.8/pickle.py", line 1577, in find_class
        __import__(module, level=0)
    ModuleNotFoundError: No module named 'dill'

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.