Skip to content

Commit

Permalink
feat: rm DETECTOR_VERSION from thisepic.sh; rm setup.sh (#733)
Browse files Browse the repository at this point in the history
This PR removed DETECTOR_VERSION from thisepic.sh, and it removes
installation of the setup.sh script.

### What kind of change does this PR introduce?
- [x] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [ ] Other: __

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [ ] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
Yes, don't use `setup.sh` anymore. It's dead Jim.

---------

Co-authored-by: Dmitry Kalinkin <[email protected]>
(cherry picked from commit 145e722)
  • Loading branch information
wdconinc authored and veprbl committed May 23, 2024
1 parent 0b6ae9e commit 948507e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
- "reports/**/*"
- "requirements.txt"
- "scripts/**/*"
- "templates/setup.sh.in"
- "templates/thisepic.sh.in"
- "views/**/*"

"topic: magnets":
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
path: install/
if-no-files-found: error
- run: |
source install/setup.sh
source install/bin/thisepic.sh
sed -i 's%\(<fiber\|<lens\)%<comment>\1%g; s%\(/fiber>\|/lens>\)%\1</comment>%g' \
${DETECTOR_PATH}/compact/ecal/barrel_interlayers.xml \
${DETECTOR_PATH}/compact/ecal/forward_scfi.xml \
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand All @@ -187,7 +187,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
root -b -q "scripts/test_ACTS.cxx+(\"${DETECTOR_PATH}/${{matrix.detector_config}}.xml\")" | tee check_tracking_geometry.out
bin/acts_geo_check check_tracking_geometry.out
Expand All @@ -207,7 +207,7 @@ jobs:
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
pushd scripts/material_map
export DETECTOR_CONFIG=epic_craterlake_material_map
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
IFS=, read -a configs <<< "${{ needs.list-detector-configs.outputs.configs_csv }}"
for config in ${configs[@]} ; do
Expand Down Expand Up @@ -301,7 +301,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
# For some reason npdet_to_step really wants a space in IFS
IFS=$' \n\t'
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | tee doc/${{matrix.detector_config}}_constants.out
Expand All @@ -364,7 +364,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
npdet_info dump ${DETECTOR_PATH}/${{matrix.detector_config}}.xml | grep -v '^\s' | grep '=' | cut -d= -f1-2 | tee doc/${{matrix.detector_config}}_constants.toml
Expand Down Expand Up @@ -432,7 +432,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
checkOverlaps --option ${{ matrix.option }} -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_tgeo.out
Expand All @@ -453,7 +453,7 @@ jobs:
- uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
checkGeometry -f true -c ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml | tee geometry_check_full.out
Expand Down Expand Up @@ -485,7 +485,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
Expand All @@ -510,7 +510,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "bridge" # this job must succeed even when new artifacts
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
mkdir -p doc
python scripts/checkOverlaps.py -c ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml | tee doc/overlap_check_geant4.out
Expand Down Expand Up @@ -569,7 +569,7 @@ jobs:
with:
platform-release: "jug_xl:nightly"
network_types: "none"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
bin/generate_prim_file -c $DETECTOR_PATH/${{ matrix.detector_config }}.xml -o prim -D -t ${{ matrix.detector_config }}
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -672,7 +672,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -G --random.seed 1 --gun.particle "${{ matrix.particle }}-" --gun.momentumMin "1*GeV" --gun.momentumMax "20*GeV" --gun.distribution "uniform" -N 100 --outputFile sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -v WARNING
- uses: actions/upload-artifact@v4
Expand All @@ -693,7 +693,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH
mkdir capybara-reports
Expand Down Expand Up @@ -731,7 +731,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
url=root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/${{matrix.beam}}/minQ2=${{matrix.minq2}}/pythia8NCDIS_${{matrix.beam}}_minQ2=${{matrix.minq2}}_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root
npsim --compactFile ${DETECTOR_PATH}/${{ matrix.detector_config }}.xml -N 100 --inputFiles ${url} --random.seed 1 --outputFile sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -v WARNING
Expand All @@ -753,7 +753,7 @@ jobs:
uses: eic/run-cvmfs-osg-eic-shell@main
with:
platform-release: "jug_xl:nightly"
setup: install/setup.sh
setup: install/bin/thisepic.sh
run: |
pip install 'pygithub>=2' 'bokeh>=3'
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ execute_process(
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
configure_file(templates/setup.sh.in ${CMAKE_CURRENT_BINARY_DIR}/setup.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.sh
configure_file(templates/thisepic.sh.in ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME this${PROJECT_NAME}.sh
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/thisepic.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}
RENAME setup.sh
)

# install programs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cmake --install build
```
To load the geometry, you can use the scripts in the `install` directory:
```bash
source install/setup.sh
source install/bin/thisepic.sh
```

### Adding/changing detector geometry
Expand Down
7 changes: 6 additions & 1 deletion templates/setup.sh.in → templates/thisepic.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
export DETECTOR=@PROJECT_NAME@
export DETECTOR_PATH=@CMAKE_INSTALL_FULL_DATADIR@/@PROJECT_NAME@
export DETECTOR_CONFIG=${1:-@PROJECT_NAME@}
export DETECTOR_VERSION=@GIT_BRANCH@

## Warn is not the right name (this script is sourced, hence $1)
if [[ "$(basename ${BASH_SOURCE[0]})" != "thisepic.sh" ]]; then
echo "Warning: This script will cease to exist at '$(realpath --no-symlinks ${BASH_SOURCE[0]})'."
echo " Please use the version at '$(realpath --no-symlinks $(dirname ${BASH_SOURCE[0]})/thisepic.sh)'."
fi

## Export detector libraries
if [[ "$(uname -s)" = "Darwin" ]] || [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down

0 comments on commit 948507e

Please sign in to comment.