From abd4b791fc63094fc0c15d2a4b58906616be84ef Mon Sep 17 00:00:00 2001 From: James McCreight Date: Sat, 26 Oct 2024 09:30:14 -0600 Subject: [PATCH] fix error and warnings in notebook 07 --- examples/07_mmr_to_mf6_chf_dfw.ipynb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/07_mmr_to_mf6_chf_dfw.ipynb b/examples/07_mmr_to_mf6_chf_dfw.ipynb index f1ad7bc9..df5322c6 100644 --- a/examples/07_mmr_to_mf6_chf_dfw.ipynb +++ b/examples/07_mmr_to_mf6_chf_dfw.ipynb @@ -312,6 +312,7 @@ " inflow_dir=inflow_dir,\n", " )\n", "\n", + " dfw.write()\n", " success, buff = dfw.run(silent=False, report=True)\n", " assert success" ] @@ -354,7 +355,9 @@ "n_substeps = int(ndays_run * 24 * 60 * 60 / tdis_perlen * tdis_nstp)\n", "substep_len = np.timedelta64(int(tdis_perlen / tdis_nstp), \"s\")\n", "sim_end_time = sim_start_time + n_substeps * substep_len\n", - "sim_times = np.arange(sim_start_time, sim_end_time, substep_len)\n", + "sim_times = np.arange(sim_start_time, sim_end_time, substep_len).astype(\n", + " \"datetime64[ns]\"\n", + ") # ns to avoid xarray warnings\n", "perioddata = tdis.perioddata.get_data()\n", "assert len(sim_times) == len(perioddata) * perioddata[0][1]" ] @@ -567,10 +570,11 @@ "outputs": [], "source": [ "# Subset to points of interest (poi), known flow gages\n", - "poi_id = np.chararray(\n", - " prms_mf6_ds[\"prms streamflow\"].nhm_seg.shape, unicode=True, itemsize=15\n", - ")\n", "empty_str = \" \" * 15\n", + "poi_id = np.full(\n", + " prms_mf6_ds[\"prms streamflow\"].nhm_seg.shape, empty_str, dtype=\"