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

When dots in the name, filenames are wrongly defined #67

Closed
perolavsvendsen opened this issue Jul 30, 2021 · 3 comments · Fixed by #68
Closed

When dots in the name, filenames are wrongly defined #67

perolavsvendsen opened this issue Jul 30, 2021 · 3 comments · Fixed by #68
Assignees
Labels
bug Something isn't working

Comments

@perolavsvendsen
Copy link
Member

When exporting data with names that include dots (.), the filenames are wrongly defined.

Example:
Horizon name in RMS: MyFormation_1.1 --> Filename: myformation_1.gri

This is problematic for several reasons, but especially when multiple horizons get the same outgoing filename.

Example:
Horizon names MyFormation_1.1, MyFormation_1.2 and MyFormation_1.3 will be exported with the same filename, hence only the last one will be exported. Also, if there is a MyFormation_1 present, this last one will look like it is this one.

@perolavsvendsen perolavsvendsen added the bug Something isn't working label Jul 30, 2021
@perolavsvendsen perolavsvendsen self-assigned this Jul 30, 2021
@perolavsvendsen
Copy link
Member Author

Looks like anything after the last . in a filename is stripped away here:

path = (Path(folder) / filename.lower()).with_suffix(ext)

@perolavsvendsen
Copy link
Member Author

But, when a filename with dots is given to XTgeo, it also strips them away. So after this line, "outfile" does not exist.

obj.to_file(outfile, fformat="irap_binary")

@perolavsvendsen
Copy link
Member Author

A possible solution that intially seems to work is to replace

path = (Path(folder) / filename.lower()).with_suffix(ext)

with...

    path = (Path(folder) / filename.lower())
    path = path.with_suffix(path.suffix + ext)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant