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

Mismatching order in package.order #4232

Closed
eshmoylova opened this issue Nov 15, 2023 · 3 comments
Closed

Mismatching order in package.order #4232

eshmoylova opened this issue Nov 15, 2023 · 3 comments
Labels
L: Math Issue addresses Modelica.Math L: Media Issue addresses Modelica.Media
Milestone

Comments

@eshmoylova
Copy link
Member

In Directory Hierarchy Mapping section of the Specification, it says:

Classes and constants that are stored in package.mo are also present in package.order but their relative order should be identical to the one in package.mo (this ensures that the relative order between classes and constants stored in different ways is preserved).

There are two cases where the order of classes in package.mo and package.order do not match:
Media/IdealGases/Common/package.mo does not match Media/IdealGases/Common/package.mo, in particular, DataRecord is not followed by SingleGasNasa in package.order

Math/package.mo does not match Math/package.order: classes defined outside of package.mo are interspersed with classes defined in package.mo.

If the the order given in package.order is preferred, the classes in package.mo need to be taken out into stand-alone files.

@eshmoylova eshmoylova added L: Math Issue addresses Modelica.Math L: Media Issue addresses Modelica.Media labels Nov 15, 2023
@eshmoylova eshmoylova added this to the MSL4.1.0 milestone Nov 15, 2023
@HansOlsson
Copy link
Contributor

In Directory Hierarchy Mapping section of the Specification, it says:

Classes and constants that are stored in package.mo are also present in package.order but their relative order should be identical to the one in package.mo (this ensures that the relative order between classes and constants stored in different ways is preserved).

There are two cases where the order of classes in package.mo and package.order do not match: Media/IdealGases/Common/package.mo does not match Media/IdealGases/Common/package.mo, in particular, DataRecord is not followed by SingleGasNasa in package.order

I don't know if the text is unclear, some misunderstanding, or the variants have diverged but what I see is that
package.order contains

  • DataRecord
  • Functions
  • SingleGasNasa
  • MixtureGasNasa
  • FluidData
  • SingleGasData

package.mo contains the ones in bold in the following order:

  • DataRecord
  • SingleGasNasa
  • MixtureGasNasa

So, the sub-set of classes in package.mo keep their relative order from package.order; the other classes Functions, FluidData, SingleGasesData are defined in other files. This allows you to freely order all of the classes (and constants) - regardless of whether they are stored in package.mo or in a separate file (or directory); and without having the weird situation that you have one order in package.mo and then shuffle them in package.order.

Math/package.mo does not match Math/package.order: classes defined outside of package.mo are interspersed with classes defined in package.mo.
If the the order given in package.order is preferred, the classes in package.mo need to be taken out into stand-alone files.

I believe it is similar here, but didn't go through all of them.

@eshmoylova
Copy link
Member Author

I submitted a separate issue against the specification modelica/ModelicaSpecification#3438 to clarify what relative order is. Will update here, depending on the decision there.

@HansOlsson HansOlsson changed the title Mismatching order in pacakge.order Mismatching order in package.order Nov 15, 2023
@eshmoylova
Copy link
Member Author

Closing. The Language group agreement was that this should be allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Math Issue addresses Modelica.Math L: Media Issue addresses Modelica.Media
Projects
None yet
Development

No branches or pull requests

2 participants