Skip to content

Commit

Permalink
#250 improve statement logic
Browse files Browse the repository at this point in the history
  • Loading branch information
D-GopalKrishna committed Feb 11, 2024
1 parent 7a8d044 commit c7be135
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/composer/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def create_statement_preview(self, instance, journey):
if not species:
species = ""

phenotype = instance.phenotype.phenotype_str if instance.phenotype else None
phenotype = instance.phenotype.phenotype_str if instance.phenotype else ''
origin_names = [origin.name for origin in instance.origins.all()]
origins = join_entities(origin_names)
if not origins:
Expand All @@ -511,19 +511,19 @@ def create_statement_preview(self, instance, journey):

# Creating the statement
if sex or species != "":
statement = f"In {sex or ''} {species}, the {phenotype.lower() if phenotype else '' } connection goes {journey_sentence}.\n"
statement = f"In {sex or ''} {species}, the {phenotype.lower()} connection goes {journey_sentence}.\n"
else:
statement = f"A {phenotype} connection goes {journey_sentence}.\n"
statement = f"A {phenotype.lower()} connection goes {journey_sentence}.\n"

statement += f"This "
if projection:
statement += f"{projection.lower() or ''} "
statement += f"{projection.lower()} "
if circuit_type:
statement += f"{circuit_type.lower() or ''} "
statement += f"{circuit_type.lower()} "

statement += f"connection projects from the {origins}."
if laterality_description:
statement = statement[:-1] + f" and is found {laterality_description or ''}.\n"
statement = statement[:-1] + f" and is found {laterality_description}.\n"

if apinatomy:
statement += f" It is described in {apinatomy} model."
Expand Down

0 comments on commit c7be135

Please sign in to comment.