Closed jasonmhite closed 4 months ago
Obviously the compiler error is only with -DSpecUtils_PYTHON_BINDINGS=1
.
Thanks for reporting this!
You are exactly right on the cause of this.
I added the second "live time" argument for the python function. If you pass 0, or a negative number for the live time, the gamma real time will be used (assuming there is a gamma spectrum for that record).
At some point I'll hopefully find time to setup automated builds to check for these kinds of issues on commits.
Bit off topic, so I can open a second issue if needed, but do you have any instructions for building the Python bindings? I wanna play with embedding SpecUtils in some code I'm developing to get better format support. I thought I knew how to build the python module, but I just get a segfault when importing the shared library. This is on an ARM Mac building with clang++ and python 3.10, I can provide more details if you think it's a platform issue.
Its probably not a platform issue, since I tested on an M1 mac yesterday.
I just added detailed build instructions for macOS in bindings/python/README.md.
But where I have gotten a segfault in the past is when using a different Python installation than boost was built against, which is a bit annoying. To make sure, when you run the bindings/python/test_python.py, use a command like the following, that explicitly uses the correct install of Python:
/opt/homebrew/opt/python3/bin/python3 test_python.py
Let me know if this, or the detailed build instructions help, -will
Thanks, I'll try that out and if I have any problems I'll start a new issue.
Over in
SpecUtils/bindings/python/SpecFile_py.cpp
,setNeutronCounts_wrapper
is:On building I get an error
It looks like at some point
set_neutron_counts
in the parent class was refactored to also take a float live time but this bit wasn't updated. As quick hack, simply changing it tomeas->set_neutron_counts( counts, 0.0 );
seems to work and the code compiles.