Comments (10)
Hello, @Sinclert ! Please check https://github.com/lyazj/tmp/raw/master/work.tar.gz for details about my run if needed. All exceptions were raised when invoking 'work(.tar.gz)/parton_lhe.py'.
Best wishes~
from madminer.
Yes, it works well after upgrading vector
to 0.8.4
, with the latest revision of MadMiner
. Thanks very much for your effective support and hope the additional tests will be of help to us!
I'll close the issue for its successful completion. Enjoy your holiday!
See you~
from madminer.
Hi @lyazj ,
Thank you for letting us know.
I created a PR to fix the initialization of MadMinerParticle
objects, so they use the class-method helpers instead of the usual constructor. For details check PR #471
from madminer.
Hi @Sinclert ,
Thanks very much! It was an interesting bug. Now it works well in creating MadMinerParticle
objects. However, maybe another bug needs fixing with class MadMinerParticle
that it doesn't assign a field named 'm' to any of its objects, but the field is referenced by function _smear_particles
at line 1034 and 1060, in file 'lhe.py'.
Exception raised as below:
Traceback (most recent call last):
File "parton_lhe.py", line 102, in <module>
lhe.analyse_samples()
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 593, in analyse_samples
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 706, in _parse_sample
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 146, in parse_lhe_file
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 346, in _parse_event
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 1034, in _smear_particles
AttributeError: 'MadMinerParticle' object has no attribute 'm'
We came very close to success. Let's try again!
Best wishes~
from madminer.
Yes, that is a different bug, related with the missing properties m
(mass) and e
(energy).
I believe the the problem relies in the inherited class, which does not provide those properties. I will change the ObjectVector4D by the inmediately descendant class (MomentumObject4D), which does in fact provides those properties.
from madminer.
@lyazj is it solved now?
from madminer.
Hello, @Sinclert !
Thanks for your effort! The last problem was perfectly solved. However, I noticed a pair of redundant parenthesis, which caused the exception below:
Traceback (most recent call last):
File "parton_lhe.py", line 102, in <module>
lhe.analyse_samples()
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 593, in analyse_samples
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 706, in _parse_sample
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 146, in parse_lhe_file
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 346, in _parse_event
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 1052, in _smear_particles
TypeError: 'numpy.float64' object is not callable
It comes from the code below(at line 1052, in file '_smear_particles'):
phi = _smear_variable(particle.phi(), phi_resolutions, pdgid)
I tried removing the redundant parenthesis, but new problem emerged:
Traceback (most recent call last):
File "parton_lhe.py", line 102, in <module>
lhe.analyse_samples()
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 593, in analyse_samples
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/lhe/lhe_reader.py", line 706, in _parse_sample
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 146, in parse_lhe_file
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 352, in _parse_event
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/interfaces/lhe.py", line 950, in _get_objects
File "/home/lyazj/.local/lib/python3.8/site-packages/madminer-0.8.1-py3.8.egg/madminer/utils/particle.py", line 54, in __iadd__
File "/home/lyazj/.local/lib/python3.8/site-packages/vector/_backends/object_.py", line 197, in __iadd__
return _replace_data(self, numpy.add(self, other)) # type: ignore
File "/home/lyazj/.local/lib/python3.8/site-packages/vector/_backends/object_.py", line 245, in __array_ufunc__
if not isinstance(_handler_of(*inputs), VectorObject):
File "/home/lyazj/.local/lib/python3.8/site-packages/vector/_methods.py", line 2550, in _handler_of
elif _handler_priority.index(
ValueError: 'madminer.utils.particle' is not in list
All this comes from following the tutorial, but without Docker. I think I should upload my code(almost as same as that in the tutorial) tomorrow, making debugging more conveniently.
from madminer.
Hi @lyazj ,
Thanks for the detailed explanation 😃
As you said, the parenthesis around particle.phi
are just deprecated, as the vector package offer phi
as a property.
Regarding the +=
(__iadd__
) operation exception, I am afraid it will be more complicated. Turns out vector
has different computing backends (awkward, numba, numpy and pure Python), in hierarchical order. They created a dispatch function so that, when two vectors belong to the same type, the proper backend operation is called, using the vector's __module__
to differentiate themselves.
With the MadMinerParticle
class we built on top of MomentumVector4D
, __module__
points to madminer.utils.particle.py, which is not recognizes by vector
as a valid Python module.
Unless I am mistaken, the definition of derived classes is something that should be allowed in the vector
package itself. I will open an issue there for us.
from madminer.
Hi @Sinclert , thanks a lot! It seems that we have some trouble in solving the latter problem and I guess you will be right. Then let's wait for vector
's responding!
Best wishes~
from madminer.
I just merged PR #474, bumping vector
to its new version (0.8.4
). Hopefully it works now🤞🏻
What this whole thread show me is that we need to include Jupyter notebooks tests into the CI. Otherwise, the set of examples will continue to fall behind and we will not realise it. I will give it a try after I return from holidays. It seems that Papermill is a good package to do so.
from madminer.
Related Issues (20)
- Migrate CI and CD from Travis CI to GitHub Actions workflows HOT 5
- Python 2 → 3 conversion error HOT 2
- Define Jupyter notebooks automatic tests HOT 2
- [Internal] Define data models HOT 1
- LHE analysis error when parsing observables
- Handling of all PDF uncertainty sets HOT 6
- Bug in calculation of full Fisher information for ensemble with calculate_covariance=False HOT 1
- Crash in load_madminer_settings in files with custom observables HOT 13
- Increase test coverage
- Remove restrictions on Dependabot GitHub Actions update HOT 2
- Add Overdetermined morphing and addtional testings HOT 1
- Error calculating Fisher information in MadMiner(v0.9.3) HOT 6
- Systematics cannot be read by MadGraph HOT 3
- AttributeError: 'AsymptoticLimits' object has no attribute '_calculate_partition_bound' HOT 3
- Use gh-action-pypi-publish v1.7.0+ APIs HOT 2
- FileNotFoundError for event generation HOT 1
- Stuck in reweighting
- Possible error in filepath lookup?
- Add matthewfeickert as collaborator with owner role on PyPI HOT 5
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 madminer.