Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications to have file_watcher.py work on mac (or windows) machine #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ pyyaml==6.0.1
python-dotenv==1.0.0
prefect==2.13.4
astropy==5.3.4
gpcam==8.1.7
BaselineRemoval==0.1.6
gpcam==8.1.7
griffe >= 0.49.0, <1.0.0
3 changes: 2 additions & 1 deletion saxswaxs_workflows/flows/file_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def add_scan_tiled(scan_filepath):
chunks=((1679,), (1475,)),
)

if scan_filepath(".edf"):
# if scan_filepath(".edf"):
if scan_filepath.endswith(".edf"):
metadata = parse_txt_accompanying_edf(scan_filepath)
else:
metadata = {}
Expand Down
22 changes: 11 additions & 11 deletions saxswaxs_workflows/flows/file_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@
logger.addHandler(logging.StreamHandler())


# parameters = JSON.load("2017-10-17-gisaxs-horizontal-cut").value
parameters = JSON.load("2017-10-23-gisaxs-horizontal-cut").value
# # parameters = JSON.load("2017-10-17-gisaxs-horizontal-cut").value
# parameters = JSON.load("2017-10-23-gisaxs-horizontal-cut").value


async def post_file_created(dataset_path):
logger.info(dataset_path)
input_file_uri = add_scan_tiled(dataset_path)
input_file_uri = input_file_uri.replace(TILED_BASE_URI, "")
parameters["input_uri_data"] = input_file_uri
logger.info(f"Scheduling flows with {input_file_uri}")
await _schedule(
deployment_name="horizontal_cut_automatic_fit/automatic_cut_and_fit",
flow_run_name=input_file_uri,
parameters=parameters,
)
# also schedule latent_space_reductions
# await schedule_latent_space_reduction(input_file_uri)
# parameters["input_uri_data"] = input_file_uri
# logger.info(f"Scheduling flows with {input_file_uri}")
# await _schedule(
# deployment_name="horizontal_cut_automatic_fit/automatic_cut_and_fit",
# flow_run_name=input_file_uri,
# parameters=parameters,
# )
# # also schedule latent_space_reductions
# # await schedule_latent_space_reduction(input_file_uri)


async def watch_directory():
Expand Down