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

ValueError: vector::_M_default_append #14

Closed
romanovzky opened this issue Jul 28, 2020 · 7 comments
Closed

ValueError: vector::_M_default_append #14

romanovzky opened this issue Jul 28, 2020 · 7 comments

Comments

@romanovzky
Copy link

romanovzky commented Jul 28, 2020

Hi there,
I was trying out this library in python using with a file I generated. This is the code I ran:

import pyhepmc_ng

adapter = pyhepmc_ng.ReaderAsciiHepMC2(filename="file.hepmc")

evt = pyhepmc_ng.GenEvent(
    momentum_unit=pyhepmc_ng.Units.GEV, length_unit=pyhepmc_ng.Units.MM
)

adapter.read_event(evt)

which returns the error

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-12-9f5860f373ad> in <module>
      7 )
      8 
----> 9 adapter.read_event(evt)

ValueError: vector::_M_default_append

Disclaimer: I am not versed in hepmc, I was following the logic from here.

Cheers

@HDembinski
Copy link
Member

Hi, thanks for trying this out. Unfortunately, we couldn't turn this project into the default Python API for HepMC3, they have their own independent Python bindings. Therefore, I cannot offer much support. I don't see something that you did wrong at first glance, it looks like a bug in our library.

tl;dr: I do not have time to support this library at the moment, so if you are doing serious work, I would recommend the official HepMC3 Python API for now.

@romanovzky
Copy link
Author

Hi @HDembinski thank you very much for your reply.

I'm sadden to hear that, I was looking forward to having a python interface that wouldn't required installing HepMC...

All the best!

@HDembinski
Copy link
Member

@romanovzky For my curiosity, did you find a solution or did you switch to the official HepMC3 Python bindings?

@romanovzky
Copy link
Author

romanovzky commented May 25, 2021

Hi @HDembinski neither to be honest. I was attempting this route to avoid having to use C++, but I just went on with it. I'm still very keen on a working python interface/wrapper, as almost all my work and workflow is strictly pythonic.


Also, I was bound to hepmc2 files, and the only hepmc3 seemed to have working python3 bindings?

@HDembinski
Copy link
Member

Thanks for the heads up. I think you can read the HepMC2 format with HepMC3.

@romanovzky
Copy link
Author

Now that you say that, I think I tried to use HepMC3 python bindings but had a similar issue. I can't recall the details as I was already not really convinced about the approach anymore. In any case, I did need to put together a FastJet routine, so using C++ was the obvious way. I just wanted to explore a python approach.

@HDembinski
Copy link
Member

I cannot reproduce this in the latest version, so hopefully updating will fix things for you.

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

No branches or pull requests

2 participants