Skip to content

Commit

Permalink
- ADD: Added set size and timeseries flag to traits/phenotypes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-raubach committed Jan 23, 2025
1 parent 5b67555 commit 10564fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Binary file modified lib/germinate-codegen-4.7.4.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
import uk.ac.hutton.ics.brapi.server.base.BaseServerResource;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;

import static jhi.germinate.server.database.codegen.tables.Phenotypecategories.PHENOTYPECATEGORIES;
Expand Down Expand Up @@ -53,6 +52,8 @@ protected BaseResult<ArrayResult<ObservationVariable>> getVariables(DSLContext c
String unitName = t.get(UNITS.UNIT_NAME);
Integer categoryId = t.get(PHENOTYPECATEGORIES.ID);
String categoryName = t.get(PHENOTYPECATEGORIES.NAME);
Integer setSize = t.get(PHENOTYPES.SETSIZE);
Boolean isTimeseries = t.get(PHENOTYPES.IS_TIMESERIES);

Scale scale = new Scale();

Expand Down Expand Up @@ -135,6 +136,12 @@ protected BaseResult<ArrayResult<ObservationVariable>> getVariables(DSLContext c

variable.setScale(scale);
variable.setTrait(trait);
variable.setAdditionalInfo(new HashMap<>());

if (setSize != null)
variable.getAdditionalInfo().put("setSize", String.valueOf(setSize));
if (isTimeseries != null)
variable.getAdditionalInfo().put("isTimeseries", String.valueOf(isTimeseries));

return variable;
}).collect(Collectors.toList());
Expand Down

0 comments on commit 10564fe

Please sign in to comment.