Skip to content

Conversation

@lucduron
Copy link
Collaborator

No description provided.

@lucduron
Copy link
Collaborator Author

Here is a script to display warnings:

import xarray as xr

from xarray_selafin.xarray_backend import SelafinBackendEntrypoint

import warnings
warnings.simplefilter("default")

slf_in = "tests/data/r3d_tidal_flats.slf"
ds = xr.open_dataset(slf_in, engine=SelafinBackendEntrypoint)
ds.selafin.write("OUT.slf")
ds.close()

The generated output:

ResourceWarning: unclosed file <_io.BufferedWriter name='OUT.slf'>
  write_serafin(filepath, ds)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.BufferedReader name='tests/data/r3d_tidal_flats.slf'>

It shows that without this PR, there are 2 warnings:

  • on the opened file to read
  • on the opened file to write

Copy link
Contributor

@tomsail tomsail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one looks good to me.
@pmav99 do you have any comments on the tests?

@tomsail
Copy link
Contributor

tomsail commented Oct 1, 2025

Hi @lucduron, would you know I actually get an error now?
The only changes from your last push is the modification from your other PR

@lucduron
Copy link
Collaborator Author

lucduron commented Oct 1, 2025

Hi @tomsail, thank for you for the integration of different PRs. I had a look and it seems that my modification on write_serafin
has been overwritten by the merge, it should be fine with my last commit.

@lucduron
Copy link
Collaborator Author

lucduron commented Oct 1, 2025

@tomsail , I noticed some changes on io_test.py due to the merge (consecutive PRs with some common modifications?), can you check that it is OK?

@tomsail
Copy link
Contributor

tomsail commented Oct 2, 2025

thanks @lucduron I took the wrong incoming changes when merging online.

some changes on io_test.py due to the merge (consecutive PRs with some common modifications?), can you check that it is OK?

In this PR, the only changes I see are the ones you did in commit 55beefe, which are fine for me. Did you mean more changes?

@lucduron
Copy link
Collaborator Author

lucduron commented Oct 2, 2025

Hi @tomsail, it seems OK indeed for the tests, sorry for the confusion.

@tomsail tomsail merged commit 3dc3285 into oceanmodeling:main Oct 2, 2025
3 of 4 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.

2 participants