feat: add data structures for particle info #42
Conversation
Congratulations 🎉. DeepCode analyzed your code in 0.366 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s DashboardEdit DeepCode’s Configurations here |
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
===========================================
- Coverage 85.34% 74.94% -10.41%
===========================================
Files 16 20 +4
Lines 2395 3105 +710
===========================================
+ Hits 2044 2327 +283
- Misses 351 778 +427
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks quite good already. I made some small specific comments.
On a larger scale:
- Can it be avoided having this deprecated version? I assume the amount of changes when replacing it are too big?
- The ParticleDatabase code seems quite large and not DRY. I have to look at it more closely later. But it seems like the loading can be shortend. So just have a single
load_from_dict
method. The individual parsers for xml yml etc would just have to provide a to dict function. I personally would also just go with a single format as default (yml) and others would have to be implemented by the user himself if she/he prefers another format.
The DeepCode error is incorrect, because |
#42 (comment) |
Note that we may also want to add some tools that allow you to create a new particle instance based on another particle instance as template in Python code (so that you can for instance create duplicates of fake particles such as an e+i- collision at different energies or hypothetical particles). But as that functionality is not yet needed, I did not spend time on creating an interface for this yet. --> #6 |
Note that it is not necessary to type definitions
Test is performed through the new ParticleDatabase class
Also rename variables named "value" if they are ambiguous
This PR will be split up into small PRs that address specific issues |
Closes #40
This PR is part of the ongoing effort to make the codebase of the expertsystem more readible.
Spin
classParticleDatabase
(dict ofParticle
object) that is to replace theparticle.DATABASE
globalParticleDatabase
requires refactoring almost the entire codebase, all old functionality has been moved to a namespaceparticle.deprecated
, which will be gradually removed in follow-up PRs.(This PR has been rebased on #41)