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

Code generation #56

Closed
wants to merge 14 commits into from
Closed

Code generation #56

wants to merge 14 commits into from

Conversation

omaus
Copy link
Collaborator

@omaus omaus commented Feb 27, 2024

This PR

Left to do:

  • (GitHub action for automatized execution?)

@omaus omaus marked this pull request as ready for review March 13, 2024 15:55
@omaus omaus requested a review from kMutagene March 13, 2024 15:56
Copy link
Member

@kMutagene kMutagene left a comment

Choose a reason for hiding this comment

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

Looks good so far, with minor changes.

Also, please incorporate code generation into the build process, so that the .fs files for the ontologies get generated the same way we currently generate the .obo files from yml
see

let buildOntologies =

This most likely means that the code generation must move into a separate project, as we must execute it before building the other projects that should contain the generated .fs files. ideally, make it a console application so we can just build and run it via a fake process

let concattedSingleValues = String.init onto.Terms.Length (fun i -> $"{toCodeString onto.Terms[i]}")
$"{baseString}{concattedSingleValues}"

toSourceCode onto
Copy link
Member

Choose a reason for hiding this comment

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

Please stop committing test scripts to repos. Pls refactor anything relevant to actual unit tests or do not commit it at all.

@@ -124,7 +133,7 @@ let expectedTermValuesSimple =
[""]
[""]
[""]
[""; "Maus"; "Keider"; "m�ller"; "oih"]
[""; "Maus"; "Keider"; "müller"; "oih"]
Copy link
Member

Choose a reason for hiding this comment

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

you seriously need to fix your encoding problems 😆

@omaus omaus requested a review from kMutagene March 21, 2024 17:00
Copy link
Member

@kMutagene kMutagene left a comment

Choose a reason for hiding this comment

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

My initial idea for this has been adding a separate runnable project (basically the same type as the build project) and invoking that from within the build project's pipelines.

However, looking at this PR, i think it would be best to set up OBO.NET.CodeGeneration as a completely separate library. This way, we can cleanly add a dependency to that package in the build project, keep the rest as-is, and also make code generation from obo files usable in other projects. Additionally, we do not bloat this repo further with another project.

I think the only thing to adapt code-wise would be parameterizing the namespace of the generated files.

What do you think @omaus?

@@ -6,6 +6,8 @@ open Fake.DotNet
open Fake.IO.Globbing.Operators
open System.IO
open Fake.IO
open ARCTokenization.StructuralOntology
Copy link
Member

Choose a reason for hiding this comment

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

While it seems to work, i really do not like this circular dependency, where the build project is dependent on one of the projects it is supposed to build.

@omaus
Copy link
Collaborator Author

omaus commented May 24, 2024

My initial idea for this has been adding a separate runnable project (basically the same type as the build project) and invoking that from within the build project's pipelines.

However, looking at this PR, i think it would be best to set up OBO.NET.CodeGeneration as a completely separate library. This way, we can cleanly add a dependency to that package in the build project, keep the rest as-is, and also make code generation from obo files usable in other projects. Additionally, we do not bloat this repo further with another project.

I think the only thing to adapt code-wise would be parameterizing the namespace of the generated files.

What do you think @omaus?

Closed due to this and since the functionality is already realized in OBO.NET.

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.

Add CodeGenerator for structural ontologies
2 participants