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

Fix component placement bug #17

Merged
merged 4 commits into from
Nov 21, 2023
Merged

Fix component placement bug #17

merged 4 commits into from
Nov 21, 2023

Conversation

g5t
Copy link
Collaborator

@g5t g5t commented Nov 21, 2023

Fixes #16 by correcting bug in generated component _{name}_setpos functions.

A recent change inadvertently used the component rotation angles in place of its position vector components.
This fixes that error and refactors extraction of the components and reference slightly to minimize the chance of a similar problem happening again.

Additionally, the compiled test instrument output data files are now loaded and checked to contain intensity.
This necessitated addition a dat file loader for point-like detectors.

Importing `__version__` from `mccode_antlr` only works if it is
installed, otherwise the `__init__` file is not evaluated(?) when
importing the module.
It is also not possible to use the importlib.resources files method to
find the registry files from an editable-installed module.

In an attempt to support ediable installs, for easier debugging of
dependent modules, the version method is defined in a new
file, version.py, which is imported and used to populate the module
__version__ property. This method is then used in place of the dunder
version throughout mccode_antlr.
The importlib.metadata module has a distribution method which can be
used to identify editable installs of modules. This is used in a bit of
a hack to locate registry files in case the importlib.resources method
fails.

Unfortunatley, the auto-generation of the grammar files does not work
for editable installs; so the whole machinery still fails.
These files *should* be static in the distributed module -- so that the
dependency on antlr can be reduced to just the runtime. But since this
is not entirely trivial to change, editable installations will continue
to not work properly.
@g5t g5t merged commit 66adcb2 into main Nov 21, 2023
11 checks passed
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

Successfully merging this pull request may close these issues.

Compiled instruments fail to transmit particles
1 participant