Skip to content

Commit

Permalink
use objective too when matching published images
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed Sep 3, 2024
1 parent 2f7b5f5 commit 3d7da9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ public void setObjective(String objective) {
this.objective = objective;
}

public boolean hasObjective() {
return StringUtils.isNotBlank(objective);
}

public String getAlignmentSpace() {
return alignmentSpace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public String lmObjective() {
return objective;
}

public boolean hasLmObjective() {
return StringUtils.isNotBlank(objective);
}

public boolean lmIsNotStaged() {
if (sample == null) {
// really cannot tell if the sample has been published to staging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ private PublishedLMImage findPublishedImage(ColorDepthMIP colorDepthMIP, List<Pu
return publishedLMImages.stream()
.filter(pi -> pi.getAlignmentSpace().equals(colorDepthMIP.alignmentSpace) ||
(CollectionUtils.isNotEmpty(aliasesForAlignmentSpace) && aliasesForAlignmentSpace.contains(pi.getAlignmentSpace())))
.filter(pi -> !pi.hasObjective() || !colorDepthMIP.hasLmObjective() || pi.getObjective().equals(colorDepthMIP.objective))
.findFirst()
.orElseGet(() -> {
LOG.warn("No published image found for {}:sample={}:as={}",
Expand Down

0 comments on commit 3d7da9c

Please sign in to comment.