-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from LSSTDESC/tqz/utils_refactor
WIP: Utils name changing
- Loading branch information
Showing
18 changed files
with
173 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,7 @@ | ||
""" Utility functions """ | ||
|
||
import os | ||
import rail | ||
import rail.core | ||
# This is a deprecative path for importing RAILDIR, it is only for the transition period | ||
# to move RAILDIR and find_rail_file to utils.path_utils | ||
|
||
RAILDIR = os.path.abspath(os.path.join(os.path.dirname(rail.core.__file__), "..", "..")) | ||
from rail.utils.path_utils import find_rail_file, RAILDIR | ||
|
||
|
||
def find_rail_file(relpath): | ||
"""Find a file somewhere in rail by searching the namespace path | ||
This lets us avoid issues that the paths can be different depending | ||
on if we have installed things from source or not | ||
""" | ||
for path_ in rail.__path__: | ||
fullpath = os.path.abspath(os.path.join(path_, relpath)) | ||
if os.path.exists(fullpath): | ||
return fullpath | ||
raise ValueError(f"Could not file {relpath} in {rail.__path__}") | ||
find_rail_file = find_rail_file |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
""" Utility functions """ | ||
|
||
import os | ||
import rail | ||
import rail.core | ||
|
||
RAILDIR = os.path.abspath(os.path.join(os.path.dirname(rail.core.__file__), "..", "..")) | ||
|
||
def find_rail_file(relpath): | ||
"""Find a file somewhere in rail by searching the namespace path | ||
This lets us avoid issues that the paths can be different depending | ||
on if we have installed things from source or not | ||
""" | ||
for path_ in rail.__path__: | ||
fullpath = os.path.abspath(os.path.join(path_, relpath)) | ||
if os.path.exists(fullpath): | ||
return fullpath | ||
raise ValueError(f"Could not file {relpath} in {rail.__path__}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.