Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

alexhroom
Copy link
Collaborator

@alexhroom alexhroom commented Feb 10, 2025

This PR adds functionality to read .ort data and models. Fixes #104

The interface is through one function and one class:

  • RATapi.utils.orso.orso_model_to_rat, which turns an ORSO model description (given as either an orsopy SampleModel or a string) into an ORSOSample dataclass, which gives bulk in and bulk out data as well as a list of layers in the model and the parameters required to define them.
  • The class RATapi.utils.orso.ORSOProject, which contains all data from an .ort file. This can then be put into a project as required.

@alexhroom alexhroom marked this pull request as draft February 10, 2025 13:06
@alexhroom alexhroom changed the title Adds .ort file reader Adds orsopy integration for .ort files and ORSO models Feb 10, 2025
@alexhroom alexhroom marked this pull request as ready for review February 13, 2025 13:40
Copy link
Collaborator

@DrPaulSharp DrPaulSharp 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, I've a few questions and things to think about.

In addition to the specific comments, I'm wondering about projects with the "substrate/liquid" geometry, and how they would work with this setup?

@alexhroom
Copy link
Collaborator Author

@DrPaulSharp to address your comment about substrate/liquid: the only thing Geometry affects is where the substrate roughness is placed (at the beginning or end). I don't think it's possible to detect which side is the substrate from just the ORSO model

@DrPaulSharp
Copy link
Collaborator

DrPaulSharp commented Feb 18, 2025

Ok, that makes sense. My concern though is that in ort_to_project the project is initialised with "air/substrate" geometry automatically, but if a model is provided that shows the geometry is "substrate/liquid" a user would likely suspect that the reader should recognise this and set the geometry accordingly. Should geometry be added alongside absorption as an input maybe?

@alexhroom
Copy link
Collaborator Author

@DrPaulSharp decided to not bother creating the whole project, which makes most of the review points fixed by being no longer relevant. see the notebook for a good idea of what I suggest as a better way of doing things (as discussed in the meeting).

One problem I'm noticing is that the data in the notebook example isn't fit very well - this isn't a good look, but it is also weird data. not sure if you can suggest anything there?

Copy link
Collaborator

@DrPaulSharp DrPaulSharp left a comment

Choose a reason for hiding this comment

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

This is looking really good and I think is the right approach to taking in this data.

As discussed, let's raise the data fit in the next project meeting and work out where to go from there.

I've one more thing I'd like you to do, could you write __str__ method for the ORSOProject and ORSOSample classes to print them out in tables like a cut down Project. How do you think we should present the model in these classes?

@alexhroom alexhroom requested a review from DrPaulSharp March 11, 2025 09:46
Copy link
Collaborator

@DrPaulSharp DrPaulSharp left a comment

Choose a reason for hiding this comment

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

Alongside my question, could you please add orso to the list of utils made available in RATapi/__init__.py

Copy link
Collaborator

@DrPaulSharp DrPaulSharp left a comment

Choose a reason for hiding this comment

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

We made it! Thanks for your hard work on this one, and particularly for keeping pushing to make this piece of code as strong and useful as possible.

@alexhroom alexhroom merged commit 8db92c2 into RascalSoftware:main Mar 14, 2025
7 checks passed
@alexhroom alexhroom deleted the 104-ort branch March 14, 2025 11:37
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.

Support for ORSO model language via orsopy
2 participants