Deltares / imod-python

🐍🧰 Make massive MODFLOW models
https://deltares.github.io/imod-python/
MIT License
17 stars 3 forks source link

API reference: namespacing is confusing #1236

Open Huite opened 10 hours ago

Huite commented 10 hours ago

As mentioned by @VermeulenPTM:

The handwritten API reference shows: image

However, the individual method shows:

image

So there's a discrepancy between imod.idf.open and imod.formats.idf.open.

I did a little checking, e.g. xarray has the same for e.g. the groupby objects: (https://docs.xarray.dev/en/stable/generated/xarray.core.groupby.DatasetGroupBy.html#xarray.core.groupby.DatasetGroupBy).html#xarray.core.groupby.DatasetGroupBy

Huite commented 8 hours ago

Somewhat to my surprise, this only shows up in the I/O methods for us.

My current explanation is that for all the other namespaces, we are importing individual function/classes (i.e. Python objects) via from imod.prepare.regridder import Regridder versus a module via from imod.formats import idf.

Huite commented 7 hours ago

This stackoverflow question seems to have the same goal in mind: https://stackoverflow.com/questions/56137571/change-the-name-of-a-module-in-python-sphinxs-autodoc#:~:text=I%20am%20looking%20to%20autodoc%20some%20functions