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

Avoid creating analysis records until --commit #55

Open
funnell opened this issue Jun 13, 2023 · 2 comments
Open

Avoid creating analysis records until --commit #55

funnell opened this issue Jun 13, 2023 · 2 comments

Comments

@funnell
Copy link
Collaborator

funnell commented Jun 13, 2023

A problem I've encountered is misspecifying application filters can result in a bunch of unwanted analysis records.

What do you think of something like:

  1. no --commit
  • check tuples for validity
  • report how many new analyses would be created, how many unprotected would be run, how many are invalid
  1. with --commit
  • create new analysis records
  • run the analyses
@juanesarango
Copy link
Contributor

Yes, I like this idea. Here we can create some logic to skip analyses creations:

isabl_cli/isabl_cli/app.py

Lines 1478 to 1504 in 78c6c44

with click.progressbar(
valid_tuples,
file=sys.stderr,
label=f"Creating analyses for {len(valid_tuples)} tuples...\t\t",
) as bar:
for i in bar:
try:
targets, references, analyses, inputs, individual = i
# self.validate_species(targets + references)
self.validate_experiments(targets, references)
analysis = self._patch_analysis(
api.create_instance(
endpoint="analyses",
application=self.application,
targets=targets,
references=references,
analyses=analyses,
individual_level_analysis=individual,
)
)
analysis["application_inputs"] = inputs
created_analyses.append(analysis)
except (exceptions.ValidationError, AssertionError) as error:
invalid_tuples.append((i, exceptions.ValidationError(*error.args)))
return created_analyses, invalid_tuples

And just show a dry-run info of how many analyses exist and how many will be created.
Are you open to work in this PR?

@funnell
Copy link
Collaborator Author

funnell commented Jun 14, 2023

Yeah I'm open to working on this

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

No branches or pull requests

2 participants