Skip to content

DM-50999: Reorganize to support EUPS-less usage#697

Merged
timj merged 9 commits intomainfrom
tickets/DM-50999
Feb 19, 2026
Merged

DM-50999: Reorganize to support EUPS-less usage#697
timj merged 9 commits intomainfrom
tickets/DM-50999

Conversation

@timj
Copy link
Member

@timj timj commented Jan 9, 2026

  • Use eups: URI to find external config.
  • Simplify config loading now that relative paths are handled automatically.
  • Remove some getPackageDir usage.
  • Allow config, policy, and corrections to appear as python package resources.

Requires lsst/obs_base#543 and lsst/obs_lsst_data#32

@timj timj force-pushed the tickets/DM-50999 branch 4 times, most recently from 40d72ac to ba2a590 Compare January 12, 2026 22:53
@timj timj force-pushed the tickets/DM-50999 branch 3 times, most recently from 2a774d7 to c8110af Compare January 26, 2026 23:24
@timj timj marked this pull request as ready for review January 26, 2026 23:29
with ResourcePath(
"resource://lsst.obs.lsst/resources/policy/latiss.yaml", forceDirectory=False
).as_local() as policy_file:
camera = yamlCamera.makeCamera(policy_file.ospath)
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be pretty easy to change makeCamera and IsrCalib.readtext to work with ResourcePath. Maybe I should do that.

@timj timj force-pushed the tickets/DM-50999 branch 3 times, most recently from d51b10d to 0e4cdb2 Compare January 30, 2026 23:14
@timj timj force-pushed the tickets/DM-50999 branch from 0e4cdb2 to f4a6831 Compare February 6, 2026 19:49
Copy link
Contributor

@erykoff erykoff left a comment

Choose a reason for hiding this comment

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

I think this is fine but I am still not sure why some places are eups: and some are resource:.
Also, have the config loads always been relative and somewhere along the way we cargo culted full paths?

@timj
Copy link
Member Author

timj commented Feb 17, 2026

Configs did not work with relative paths until lsst/pex_config#131 where the code was "fixed" to make it work properly (otherwise it would try to load relative to cwd). Hence all the __file__ shenanigans (which replaced a load of getPackageDir calls). The fixes to pex_config make things much simpler.

timj added 6 commits February 19, 2026 09:52
This is already where there existed other data files so it's
better to put them in a single place with the tests. This did
require that each test file declares where the test directory
is but that doesn't seem completely unreasonable.
…s tree

Retain original locations for now.

policy can not be moved because of scons but the camera files are copied into
the python resources tree.

Once things stabilize we can move the primary location of config and
corrections inside the python tree and reverse the symlinks. Keep
the original locations to minimize diffs and chances of conflicts
during prototyping when DP2 is being actively worked on.
@timj
Copy link
Member Author

timj commented Feb 19, 2026

The eups:// has to be used when referring to a package that hasn't yet been converted to support resources directly. There is one config referring to a meas package.

resource:// can be used for packages that have been migrated. I see one eups pointing to obs_lsst_data that I did before I migrated obs_lsst_data so I can fix that one. It's more explicit to use resource:// if it works since it removes the guess work if the _DIR env var is not set.

@timj
Copy link
Member Author

timj commented Feb 19, 2026

@erykoff I think at one point you asked about readText supporting ResourcePath. I think that is something we can ticket but there are lots of IsrCalib classes that would need to be modified to support it and they all have to be converted at once before it can be used.

@timj timj merged commit 59157cb into main Feb 19, 2026
5 checks passed
@timj timj deleted the tickets/DM-50999 branch February 19, 2026 22:57
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.

2 participants