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

Improve the file loading mechansims #307

Merged
merged 2 commits into from
May 27, 2024
Merged

Conversation

andlaus
Copy link
Collaborator

@andlaus andlaus commented May 24, 2024

This PR refactors the file loading mechanism with the goal to be able to create databases from multiple constitutive files. It works by introducing a new user facing odxtools.load_files(filename1, filename2, ...) function.

Besides this, odxtools.load_directory(dirname) is added. This function loads all files contained in a directory into a single database. The main application is probably to directly load an unzipped PDX file. This is a quite convenient feature when developing tools or a dataset.

Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information

@andlaus andlaus requested a review from kayoub5 May 24, 2024 08:08
@andlaus
Copy link
Collaborator Author

andlaus commented May 24, 2024

this fixes #224 and hopefully #283.

@QWander: can you check if the references are properly resolved if you load your dataset using

odxtools.load_files('myFile1.odx-d', 'myFile2.odx-d', ...)

this refactors the file loading mechanism with the goal to create a
database from multiple constituive files. It works by introducing a
new user facing `odxtools.load_files(filename1, filename2, ...)`
function.

Besides this, `odxtools.load_directory(dirname)` is added. This
function loads all files contained in a directory into a single
database. The main application is probably to directly load an
unzipped PDX file. This is a quite convenient feature when developing
tools or a dataset.

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Florian Jost <florian.jost@mbition.io>
odxtools/loadfile.py Outdated Show resolved Hide resolved
odxtools/loadfile.py Outdated Show resolved Hide resolved
odxtools/loadfile.py Outdated Show resolved Hide resolved
thanks to [at]kayoub5 for the suggestion!

Signed-off-by: Andreas Lauser <andreas.lauser@mbition.io>
Signed-off-by: Florian Jost <florian.jost@mbition.io>
@andlaus andlaus merged commit 4c95e11 into mercedes-benz:main May 27, 2024
7 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.

None yet

2 participants