SeismicData / pyasdf

Python Interface to ASDF based on ObsPy
http://seismicdata.github.io/pyasdf/
BSD 3-Clause "New" or "Revised" License
53 stars 30 forks source link

Failed to flush and close #78

Open zibiwilczynski opened 3 months ago

zibiwilczynski commented 3 months ago

Hi,

when running ds.add_waveforms, after the loop is done and the script terminates, I get the message: /miniconda3/envs/noisepy/lib/python3.10/site-packages/pyasdf/asdf_data_set.py:308: ASDFWarning: Failed to flush and close the file due to: __enter__

However, the waveforms are added correctly to the file so everything works fine.

Same for ds.add_stationxml

Regards Zibi

tianzeliu commented 2 months ago

I am experiencing the same issue.

CCstarry commented 3 weeks ago

I get the same ASDFWarning: Failed to flush and close the file due to: enter, and wish someone can solve the problem. Here is my code: import pyasdf event_id = "./ASDFDataSet/event_01.h5" ds = pyasdf.ASDFDataSet(event_id)

CCstarry commented 3 weeks ago

Through several tests, I found that the ASDFWarning has no substantial impact on my program. And the warning can be not displayed by using: import warnings warnings.filterwarnings("ignore", category = UserWarning, module = 'pyasdf')