PecanProject / bety

Web-interface to the Biofuel Ecophysiological Traits and Yields Database (used by PEcAn and TERRA REF)
https://www.betydb.org
BSD 3-Clause "New" or "Revised" License
16 stars 38 forks source link

Change bulk upload (via wizard or API) to allow for traits not in the trait_covariate_associations table #459

Closed gsrohde closed 7 years ago

gsrohde commented 7 years ago

See https://github.com/terraref/computing-pipeline/issues/193#issuecomment-259544235 for discussion of how this should work.

gsrohde commented 7 years ago

Changes for the API have been implemented (but not deployed). This changes the API behavior as follows.

[From issue #193:]

  1. Any column heading that matches an existing variable name will be recognized as a trait variable except (a) if it is listed in the trait_covariate_associations table as a covariate; (b) in the unlikely event that it also happens to match one of the canonical column headings—citation_author, citation_year, citation_title, citation_doi, cultivar, species, site, treatment, utc_datetime, local_datetime, date, yield, n, SE, notes, access_level, or entity. (This rule is mainly to prevent everything from breaking if someone somewhat perversely adds one of these unlikely names as the name of a variable.)
  2. The use cases for adding a row to the trait_covariate_associations table are (a) we wish to recognize a column heading as the name of a covariate variable associated with some (or some set of) trait variable(s); (b) we wish to enforce a requirement for certain trait variables that certain associated covariates always be specified. (For example, on https://betydb.org, leafT must always be specified when trait data for Vcmax, quantum_yield, Amax or certain other variables is uploaded.)

In addition, it is an error if there is a variable name listed in the heading that corresponds to a covariate in the trait_covariate_associations table without there also being a corresponding trait name.

gsrohde commented 7 years ago

Fixed by release 4.15.

gsrohde commented 7 years ago

Re-opening. This feature is not yet working properly.

gsrohde commented 7 years ago

@dlebauer I made a note that this was not yet working properly, but I don't remember who reported this or any other details.

dlebauer commented 7 years ago

If I have a csv upload with a column name that matches a name in the variables table, it should insert the values into the traits table. The absence of a covariate is irrelevant.

The traits covariates associations table is useful when there is a covariate. But it should not prevent inserting variables that do not require a covariate. On Fri, Jun 2, 2017 at 5:34 PM Scott Rohde notifications@github.com wrote:

Assigned #459 https://github.com/PecanProject/bety/issues/459 to @dlebauer https://github.com/dlebauer.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/PecanProject/bety/issues/459#event-1108563544, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcX55N3sIJNad7HFeTt7DmIcNXsiNCIks5sAIVrgaJpZM4Ku4-- .