-
Notifications
You must be signed in to change notification settings - Fork 0
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 #6 from dirac-institute/awo/parsl-poc
Scaffolding version of the workflow structure that reproduces the manual steps
- Loading branch information
Showing
15 changed files
with
262 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
from .dev_configuration import dev_resource_config | ||
from .klone_configuration import klone_resource_config | ||
|
||
__all__ = ["dev_resource_config", "klone_resource_config"] |
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,7 +1,11 @@ | ||
from .reproject_ic import reproject_ic | ||
from .ic_to_wu import ic_to_wu | ||
from .kbmod_search import kbmod_search | ||
from .reproject_wu import reproject_wu | ||
from .uri_to_ic import uri_to_ic | ||
|
||
__all__ = [ | ||
"reproject_ic", | ||
"ic_to_wu", | ||
"kbmod_search", | ||
"reproject_wu", | ||
"uri_to_ic", | ||
] |
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,11 @@ | ||
def ic_to_wu(ic_file=None, wu_file=None, logger=None): | ||
logger.info("In the ic_to_wu task_impl") | ||
with open(ic_file, "r") as f: | ||
for line in f: | ||
value = line.strip() | ||
logger.info(line.strip()) | ||
|
||
with open(wu_file, "w") as f: | ||
f.write(f"Logged: {value}") | ||
|
||
return wu_file |
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,11 @@ | ||
def kbmod_search(input_wu=None, result_file=None, logger=None): | ||
logger.info("In the kbmod_search task_impl") | ||
with open(input_wu, "r") as f: | ||
for line in f: | ||
value = line.strip() | ||
logger.info(line.strip()) | ||
|
||
with open(result_file, "w") as f: | ||
f.write(f"Logged: {value}") | ||
|
||
return result_file |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
def reproject_wu(input_wu=None, reprojected_wu=None, logger=None): | ||
logger.info("In the reproject_wu task_impl") | ||
with open(input_wu, "r") as f: | ||
for line in f: | ||
value = line.strip() | ||
logger.info(line.strip()) | ||
|
||
with open(reprojected_wu, "w") as f: | ||
f.write(f"Logged: {value}") | ||
|
||
return reprojected_wu |
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,44 +1,57 @@ | ||
import os | ||
import glob | ||
from kbmod import ImageCollection | ||
|
||
# from kbmod import ImageCollection | ||
|
||
|
||
def uri_to_ic(target_uris_file=None, uris_base_dir=None, ic_output_file=None, logger=None): | ||
# Load the list of images from our saved file "sample_uris.txt" | ||
uris = [] | ||
with open(target_uris_file) as f: | ||
for l in f.readlines(): | ||
l = l.strip() # seeing invisible trailing characters 6/12/2024 COC | ||
if l == "": | ||
continue # skip blank lines 6/12/2024 COC | ||
if not l.startswith("#"): | ||
# Ignore commented metadata | ||
uris.append(l) | ||
|
||
if uris_base_dir is not None: | ||
logger.debug(f"Using URIs base dir: {uris_base_dir}") | ||
if not os.path.isdir(uris_base_dir): | ||
logger.error(f"Invalid URIS base directory provided: {uris_base_dir}") | ||
raise ValueError(f"Invalid URIS base directory provided: {uris_base_dir}") | ||
|
||
# Clean up the URI strings | ||
for i in range(len(uris)): | ||
file_prefix = "file://" | ||
curr = uris[i].replace("%23", "#").strip() | ||
if curr.startswith(file_prefix): | ||
curr = curr[len(file_prefix) :] | ||
if uris_base_dir is not None: | ||
curr = os.path.join(uris_base_dir, curr.lstrip(os.path.sep)) | ||
uris[i] = curr | ||
|
||
# Make sure the files can all be found 6/12/2024 COC | ||
for uri in uris: | ||
if len(glob.glob(uri)) == 0: | ||
raise FileNotFoundError(f"Could not find {uri}.") | ||
|
||
logger.info("Creating ImageCollection") | ||
# Create an ImageCollection object from the list of URIs | ||
ic = ImageCollection.fromTargets(uris) | ||
logger.info("ImageCollection created") | ||
|
||
ic.write(ic_output_file, format="ascii.ecsv") | ||
with open(target_uris_file, "r") as f: | ||
for line in f: | ||
value = line.strip() | ||
logger.info(line.strip()) | ||
|
||
with open(ic_output_file, "w") as f: | ||
f.write(f"Logged: {value}") | ||
|
||
return ic_output_file | ||
|
||
|
||
# def uri_to_ic(target_uris_file=None, uris_base_dir=None, ic_output_file=None, logger=None): | ||
# # Load the list of images from our saved file "sample_uris.txt" | ||
# uris = [] | ||
# with open(target_uris_file) as f: | ||
# for l in f.readlines(): | ||
# l = l.strip() # seeing invisible trailing characters 6/12/2024 COC | ||
# if l == "": | ||
# continue # skip blank lines 6/12/2024 COC | ||
# if not l.startswith("#"): | ||
# # Ignore commented metadata | ||
# uris.append(l) | ||
|
||
# if uris_base_dir is not None: | ||
# logger.debug(f"Using URIs base dir: {uris_base_dir}") | ||
# if not os.path.isdir(uris_base_dir): | ||
# logger.error(f"Invalid URIS base directory provided: {uris_base_dir}") | ||
# raise ValueError(f"Invalid URIS base directory provided: {uris_base_dir}") | ||
|
||
# # Clean up the URI strings | ||
# for i in range(len(uris)): | ||
# file_prefix = "file://" | ||
# curr = uris[i].replace("%23", "#").strip() | ||
# if curr.startswith(file_prefix): | ||
# curr = curr[len(file_prefix) :] | ||
# if uris_base_dir is not None: | ||
# curr = os.path.join(uris_base_dir, curr.lstrip(os.path.sep)) | ||
# uris[i] = curr | ||
|
||
# # Make sure the files can all be found 6/12/2024 COC | ||
# for uri in uris: | ||
# if len(glob.glob(uri)) == 0: | ||
# raise FileNotFoundError(f"Could not find {uri}.") | ||
|
||
# logger.info("Creating ImageCollection") | ||
# # Create an ImageCollection object from the list of URIs | ||
# ic = ImageCollection.fromTargets(uris) | ||
# logger.info("ImageCollection created") | ||
|
||
# ic.write(ic_output_file, format="ascii.ecsv") |
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,3 +1,5 @@ | ||
from .configuration_utilities import get_resource_config | ||
from .executor_utilities import get_executors | ||
from .logger_utilities import configure_logger | ||
|
||
__all__ = ["configure_logger"] | ||
__all__ = ["get_resource_config", "get_executors", "configure_logger"] |
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.