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

Establish an ExportResult object to return from simplified functions #800

Open
mferrera opened this issue Sep 24, 2024 · 0 comments
Open

Comments

@mferrera
Copy link
Collaborator

mferrera commented Sep 24, 2024

TODO: needs refinement and maturation

We can and should return an object from the simplified export functions. This object will be useful for QC/information, for testing, for capturing information that may come in the future regarding sumo or upload status, and potentially for use cases we are not yet aware of.

A minimum viable product can look like this:

@dataclass
class ExportResultItem:
    relative_path: Path
    absolute_path: Path

# fmu.dataio.export.ExportResult ?
@dataclass
class ExportResult:
    items: list[ExportResultItem]

A simple use case for users is to print the location and names of exported files.

result = export_something()
for item in result.items:
    print(item.relative_path)  # => "path/to/file.type"

# Or, provide a method
result.print_filepaths()
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

No branches or pull requests

1 participant