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

VSKit - description newline replacement #691

Merged
merged 3 commits into from
Dec 20, 2023

Conversation

plbremer
Copy link
Contributor

VSKit generates "descriptions" for LinkML from ontologies. Sometimes, those descriptions contain newline characters. These newline characters break downstream LinkML tooling such as the Pydantic generator.

I believe that it is appropriate to replace those newline characters with spaces at this point in the flow.

An example of this newline phenomenon is the permissible value IP-seq from EFO:

      IP-seq:
        text: IP-seq
        description: "IP-seq is an assay in which immunoprecipitation with high throughput\
          \ sequencing is used to identify the DNA/RNA-associated proteins or protein\
          \ complexes.\nAs an immunoprecipitation it can be ChIP, RIP or another immunoprecipitation\
          \ process."
        meaning: EFO:0005032
        title: IP-seq

Which does not look the same as, for example, its rendering on EBI
https://www.ebi.ac.uk/ols4/ontologies/efo/classes?short_form=EFO_0005032

@@ -183,6 +183,8 @@ def _generate_permissible_value(
enum_definition: EnumDefinition = None,
) -> PermissibleValue:
definition = oi.definition(curie)
# \n can break some downstream tooling like LinkML's gen-pydantic (v1.6.6)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be fixed in the tooling, as newlines are valid (if unusual) in textual elements. But we can merge this for now

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (65f95f1) 76.49% compared to head (ebeae4a) 76.03%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #691      +/-   ##
==========================================
- Coverage   76.49%   76.03%   -0.47%     
==========================================
  Files         252      252              
  Lines       29370    29372       +2     
==========================================
- Hits        22468    22332     -136     
- Misses       6902     7040     +138     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmungall cmungall merged commit 68abc1c into INCATools:main Dec 20, 2023
5 checks passed
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.

3 participants