Skip to content

Commit

Permalink
Update Analzye Semantics
Browse files Browse the repository at this point in the history
This PR allows for workspaces which arr not fully setup, to successfully
pass through analzye without error. Experiments that are not setup are
now skipped instead
  • Loading branch information
rfbgo committed Apr 4, 2024
1 parent 9d3e7ef commit 34b2f98
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
7 changes: 3 additions & 4 deletions lib/ramble/ramble/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,11 +1398,10 @@ def _analyze_experiments(self, workspace, app_inst=None):
"""

if self.get_status() == experiment_status.UNKNOWN.name and not workspace.dry_run:
logger.die(
f'Workspace status is {self.get_status()}\n'
'Make sure your workspace is fully setup with\n'
' ramble workspace setup'
logger.warn(
f'Experiment has status is {self.get_status()}. Skipping analysis..\n'
)
return

def format_context(context_match, context_format):

Expand Down
24 changes: 17 additions & 7 deletions lib/ramble/ramble/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,24 @@ def __init__(self, workspace, filters, output_formats=['text'], upload=False):
self.upload_results = upload

def _prepare(self):
for _, app_inst, _ in self._experiment_set.filtered_experiments(self.filters):

# We only want to let the user run analyze if one of the following is true:
# - At least one expeirment is set up
# - `--dry-run` is enabled
found_valid_experiment = False
for exp, app_inst, _ in self._experiment_set.filtered_experiments(self.filters):
if not (app_inst.is_template or app_inst.repeats.is_repeat_base):
if app_inst.get_status() == ramble.application.experiment_status.UNKNOWN.name:
logger.die(
f'Workspace status is {app_inst.get_status()}\n'
'Make sure your workspace is fully setup with\n'
' ramble workspace setup'
)
if app_inst.get_status() != ramble.application.experiment_status.UNKNOWN.name:
found_valid_experiment = True

if not found_valid_experiment and self._experiment_set.num_experiments() \
and not self.workspace.dry_run:
logger.die(
'No analyzeable experiment detected.'
' Make sure your workspace is setup with\n'
' ramble workspace setup'
)

super()._construct_hash()
super()._prepare()

Expand Down

0 comments on commit 34b2f98

Please sign in to comment.