Skip to content

Commit

Permalink
replace eups calls with lsst.utils.getPackageDir()
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt committed May 22, 2015
1 parent 2f4471b commit f99ce12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bin/genDefectRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

import pyfits

import eups
import lsst.utils

if len(sys.argv) < 2:
raise RuntimeError("Must provide a phosim version against which these defects are valid")

phosimVersion = sys.argv[1]
baseDir = eups.productDir("obs_lsstSim")
baseDir = lsst.utils.getPackageDir('obs_lsstsim')
registryDir = os.path.join(os.path.normpath(baseDir), "description", "defects")
registryPath = os.path.join(registryDir, "defectRegistry.sqlite3")

Expand Down
4 changes: 2 additions & 2 deletions bin/makeLsstCameraRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import re
import shutil

import eups
import lsst.utils
import lsst.afw.geom as afwGeom
import lsst.afw.table as afwTable
from lsst.afw.cameraGeom import (DetectorConfig, CameraConfig, PUPIL, FOCAL_PLANE, PIXELS)
Expand Down Expand Up @@ -247,7 +247,7 @@ def makeDetectorConfigs(detectorLayoutFile, phosimVersion):
DetectorLayoutFile -- https://dev.lsstcorp.org/cgit/LSST/sims/phosim.git/plain/data/lsst/focalplanelayout.txt?h=dev
SegmentsFile -- https://dev.lsstcorp.org/cgit/LSST/sims/phosim.git/plain/data/lsst/segmentation.txt?h=dev
"""
baseDir = eups.productDir("obs_lsstSim")
baseDir = lsst.utils.getPackageDir('obs_lsstsim')
defaultOutDir = os.path.join(os.path.normpath(baseDir), "description", "camera")

parser = argparse.ArgumentParser()
Expand Down
1 change: 1 addition & 0 deletions ups/obs_lsstSim.table
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ setupRequired(meas_algorithms)
setupRequired(ip_isr)
setupRequired(pipe_tasks)
setupRequired(mysqlpython)
setupRequired(utils)

envPrepend(LD_LIBRARY_PATH, ${PRODUCT_DIR}/lib)
envPrepend(DYLD_LIBRARY_PATH, ${PRODUCT_DIR}/lib)
Expand Down

7 comments on commit f99ce12

@timj
Copy link
Member

@timj timj commented on f99ce12 May 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So again, these patches are trying to locate itself. Why should it need an environment variable to be set to locate itself for testing? Couldn't that lead to weird mismatches if a different package has been setup to the one that is expected to be used?

@jhoblitt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the scons manual and its not obvious to me what the autotools equiv of src_dir is supposed to be. There are warnings about not using src_dir.

@timj
Copy link
Member

@timj timj commented on f99ce12 May 22, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't python know where the test file is located though?

@jhoblitt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Doing it that way would require each file to know it's relative path to the root. The build tool really should provide the path to the root of the source tree.

@RobertLuptonTheGood
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does. Look at # as a prefix in the scons manual

@jhoblitt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And how do you ask that be expanded to a string literal? Value('#')?

@RobertLuptonTheGood
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.