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

Changes to sample data editing #781

Open
wants to merge 3 commits into
base: testing
Choose a base branch
from

Conversation

zsloan
Copy link
Contributor

@zsloan zsloan commented May 11, 2023

This PR will make a couple changes to sample data editing:

  • Values will be editable for samples that don't currently have values. Currently you can only edit sample values for samples that already have values; this is because it just pulls the sample data from the DB and wasn't accounting for the sample list
  • It will be possible to submit sample data changes via an HTML table, instead of just as a CSV import

The corresponding GN3 PR is here - genenetwork/genenetwork3#117

This doesn't yet support adding sample data for samples that don't already have values
Also fix the display so it only shows 3 decimal places
Deletions aren't working yet. This is dependent on a GN3 chance that allows the sample_list to be passed to get_trait_csv_sample_data
Copy link
Collaborator

@BonfaceKilz BonfaceKilz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments; otherwise this LGTM.

@@ -171,7 +179,7 @@ def update_phenotype(dataset_id: str, name: str):
or ""
)
phenotype_id = str(data_.get("phenotype-id"))
if not (file_ := request.files.get("file")):
if not (file_ := request.files.get("file")) and data_.get('edited') == "false":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: issue: This seems odd to me. Doing a string comparison the string "false". If there's a way to do directly with a boolean value, it would make this easier to both debug and read.

base_csv_lines = base_csv.split("\n")
delta_csv_lines = [base_csv_lines[0]]

for line in base_csv_lines[1:]:
Copy link
Contributor

@jgarte jgarte May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zsloan @BonfaceKilz, maybe there's a way to code this that doesn't have a high cyclomatic complexity?

Otherwise, #781 LGTM

Feel free to ignore if you think this is a nitpick...

@zsloan
Copy link
Contributor Author

zsloan commented May 12, 2023 via email

@fredmanglis fredmanglis force-pushed the testing branch 2 times, most recently from 04f10df to 5474e66 Compare April 24, 2024 04:54
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

Successfully merging this pull request may close these issues.

None yet

3 participants