Skip to content

Commit

Permalink
Added logic to run xrf_maps from any directory. No longer need to run…
Browse files Browse the repository at this point in the history
… it from bin
  • Loading branch information
Arthur Glowacki committed Mar 6, 2024
1 parent bbe5f5c commit f9092e4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
16 changes: 12 additions & 4 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,10 +905,18 @@ int main(int argc, char* argv[])
//Performance measure
std::chrono::time_point<std::chrono::system_clock> start, end;

// get location of where we are running from and use it to find ref files
std::string exe_loc = std::string(argv[0]);
int prog_idx = exe_loc.find("xrf_maps");
if (prog_idx > 0)
{
exe_loc = exe_loc.substr(0, prog_idx);
}

//////// HENKE and ELEMENT INFO /////////////
const std::string element_csv_filename = "../reference/xrf_library.csv";
const std::string element_henke_filename = "../reference/henke.xdr";
const std::string scaler_lookup_yaml = "../reference/Scaler_to_PV_map.yaml";
const std::string element_csv_filename = exe_loc + "../reference/xrf_library.csv";
const std::string element_henke_filename = exe_loc + "../reference/henke.xdr";
const std::string scaler_lookup_yaml = exe_loc + "../reference/Scaler_to_PV_map.yaml";

start = std::chrono::system_clock::now();

Expand All @@ -929,7 +937,7 @@ int main(int argc, char* argv[])
logE << "loading element information: " << "\n";
return -1;
}

Command_Line_Parser clp(argc, argv);

if (clp.option_exists("-h"))
Expand Down
2 changes: 1 addition & 1 deletion src/support/eigen-git-mirror
Submodule eigen-git-mirror updated from a96545 to 454f89
2 changes: 1 addition & 1 deletion src/support/pybind11
Submodule pybind11 updated 44 files
+1 −1 .github/CONTRIBUTING.md
+12 −11 .github/workflows/ci.yml
+1 −1 .github/workflows/configure.yml
+1 −1 .github/workflows/format.yml
+3 −3 .github/workflows/pip.yml
+1 −1 .github/workflows/upstream.yml
+12 −17 .pre-commit-config.yaml
+16 −1 CMakeLists.txt
+4 −5 docs/advanced/exceptions.rst
+5 −3 include/pybind11/cast.h
+3 −5 include/pybind11/detail/class.h
+8 −0 include/pybind11/detail/common.h
+1 −1 include/pybind11/detail/init.h
+2 −0 include/pybind11/detail/internals.h
+45 −8 include/pybind11/detail/type_caster_base.h
+9 −1 include/pybind11/gil.h
+91 −0 include/pybind11/gil_safe_call_once.h
+32 −10 include/pybind11/numpy.h
+23 −20 include/pybind11/pybind11.h
+4 −4 include/pybind11/pytypes.h
+3 −2 include/pybind11/stl_bind.h
+1 −1 noxfile.py
+3 −1 pybind11/setup_helpers.py
+7 −10 pyproject.toml
+1 −0 tests/CMakeLists.txt
+1 −0 tests/extra_python_package/test_files.py
+14 −8 tests/requirements.txt
+14 −0 tests/test_class.py
+1 −3 tests/test_enum.py
+6 −2 tests/test_exceptions.cpp
+19 −15 tests/test_methods_and_attributes.py
+1 −1 tests/test_numpy_array.py
+1 −1 tests/test_numpy_dtypes.cpp
+45 −0 tests/test_python_multiple_inheritance.cpp
+35 −0 tests/test_python_multiple_inheritance.py
+2 −2 tests/test_pytypes.cpp
+9 −0 tests/test_sequences_and_iterators.py
+70 −0 tests/test_stl_binders.cpp
+14 −0 tests/test_stl_binders.py
+27 −1 tools/make_changelog.py
+21 −11 tools/pybind11Common.cmake
+1 −1 tools/pybind11Config.cmake.in
+40 −3 tools/pybind11NewTools.cmake
+1 −1 tools/pybind11Tools.cmake
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 434 files

0 comments on commit f9092e4

Please sign in to comment.