DHI / mikeio

Read, write and manipulate dfs0, dfs1, dfs2, dfs3, dfsu and mesh files.
https://dhi.github.io/mikeio
BSD 3-Clause "New" or "Revised" License
136 stars 53 forks source link

Simplify Dfsu #657

Closed ecomodeller closed 4 months ago

ecomodeller commented 4 months ago

This remove

I.e. the ability to open a Dfsu file and then append data.

Suggested workflow for files larger than memory is:

  1. Use mikecore to append to an existing file, e.g:

    dfs = DfsFileFactory.DfsGenericOpenEdit(fp)
    n_items = len(dfs.ItemInfo)
    n_elements = dfs.ItemInfo[0].ElementCount
    
    for _ in range(nt):
      for _ in range(n_items):
          data = np.random.random(size=n_elements).astype(
              np.float32
          )  # Replace with actual data
          dfs.WriteItemTimeStepNext(0.0, data)
    dfs.Close()
  2. mikeio.generic.concat