You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to the model itself, there can also exist auxiliary files next to it. These files are defined by users of the model. This will be especially useful in conjunction with the GitFileHandler or similar, where such files would be downloaded automatically and transparently to the user.
In order to implement this functionality, we first need to define an appropriate API:
How files can be accessed from a MelodyModel instance.
How the MelodyLoader provides access to the underlying file handler.
How to access directories and enumerate files in them.
The first two points can be solved in a very simple and effective manner by exposing the actual FileHandler object. This allows the FileHandler to implement any arbitrary API without having to worry about name collisions with attributes of the model object.
For the last point we can implement a PathLike API. This is both user friendly and allows code that works with pathlib.Path objects to also transparently handle files in the file handler.
The text was updated successfully, but these errors were encountered:
No, this has nothing to do with libraries. In fact, the original feature request actually was never about the MelodyModel at all, but came from someone who is using the GitFileHandler outside of a model context for accessing git repos with arbitrary (non-Capella-related) files. However, having this functionality implemented in a more generic way may also be useful for working with files that are closely related to a model, but not bound to it by the meta-model.
In addition to the model itself, there can also exist auxiliary files next to it. These files are defined by users of the model. This will be especially useful in conjunction with the GitFileHandler or similar, where such files would be downloaded automatically and transparently to the user.
In order to implement this functionality, we first need to define an appropriate API:
MelodyModel
instance.MelodyLoader
provides access to the underlying file handler.The first two points can be solved in a very simple and effective manner by exposing the actual FileHandler object. This allows the FileHandler to implement any arbitrary API without having to worry about name collisions with attributes of the model object.
For the last point we can implement a
PathLike
API. This is both user friendly and allows code that works withpathlib.Path
objects to also transparently handle files in the file handler.The text was updated successfully, but these errors were encountered: