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

Path management #324

Open
FFroehlich opened this issue Dec 2, 2024 · 1 comment · Fixed by #327
Open

Path management #324

FFroehlich opened this issue Dec 2, 2024 · 1 comment · Fixed by #327

Comments

@FFroehlich
Copy link
Collaborator

When generating a petab.Problem from a yaml file, all files are automatically prefixed by the location of the yaml file. However when directly passing the corresponding dict (potentially after manipulation), it is no longer possible to specify a prefix and the only way for the import to work correctly is to os.chdir to the appropriate directory.

Straightforward to add a corresponding command line argument, but I guess it would be generally great to store a prefix path somewhere in the generated petab.Problem, as this would make it easier to reference files within the problem (not part of the current spec afaik, but it would be great to have in the future).

Opinions?

@dweindl
Copy link
Member

dweindl commented Dec 2, 2024

However when directly passing the corresponding dict (potentially after manipulation), it is no longer possible to specify a prefix and the only way for the import to work correctly is to os.chdir to the appropriate directory.

Right. Adding an argument for that to petab.Problem.from_yaml would definitely make sense.

store a prefix path somewhere in the generated petab.Problem

Somewhat related, I was planning to introduce some object representing the problem-yaml and adding that to petab.Problem. A base directory could easily be added there. This would also provide access to file names that are otherwise lost, and could be used (in simple cases) as default arguments to petab.Problem.to_files, which is currently pretty inconvenient to use...

dweindl added a commit to dweindl/libpetab-python that referenced this issue Dec 3, 2024
Introduces Problem.config which contains the info from the PEtab yaml file.

Sometimes it is convenient to have the original filenames around.

Closes PEtab-dev#324.
dweindl added a commit to dweindl/libpetab-python that referenced this issue Dec 3, 2024
When passing the problem configuration as `dict` to
`Problem.from_yaml`, one should be able to specify
the base path for resolving relative paths. See PEtab-dev#324.

Closes PEtab-dev#324
dweindl added a commit that referenced this issue Dec 3, 2024
When passing the problem configuration as `dict` to
`Problem.from_yaml`, one should be able to specify
the base path for resolving relative paths. See #324.

Closes #324
dweindl added a commit to dweindl/libpetab-python that referenced this issue Dec 3, 2024
Introduces Problem.config which contains the info from the PEtab yaml file.

Sometimes it is convenient to have the original filenames around.

Closes PEtab-dev#324.
@dweindl dweindl linked a pull request Dec 4, 2024 that will close this issue
dweindl added a commit to dweindl/libpetab-python that referenced this issue Dec 9, 2024
Introduces Problem.config which contains the info from the PEtab yaml file.

Sometimes it is convenient to have the original filenames around.

Closes PEtab-dev#324.
dweindl added a commit to dweindl/libpetab-python that referenced this issue Dec 9, 2024
Introduces Problem.config which contains the info from the PEtab yaml file.

Sometimes it is convenient to have the original filenames around.

Closes PEtab-dev#324.
dweindl added a commit that referenced this issue Dec 9, 2024
Introduces Problem.config which contains the info from the PEtab yaml file.

Sometimes it is convenient to have the original filenames around.

Pydantic gives more helpful error messages than `jsonschema` in case of incorrect inputs. Later on, this could replace  `jsonschema` completely.

Closes #324.
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 a pull request may close this issue.

2 participants