Make fitting_parallel.py private to make sure function parallel_fit_dask is imported from astropy.modeling.fitting#16974
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
e189c17 to
350628d
Compare
|
Broke RTD
|
|
pre-commit.ci autofix |
Didn't see RTD was broken, withdrawing approval
|
Huh, any idea why this would have broken RTD? |
|
The ref does not exist anymore because module is private? |
|
But the ref is pointing to the fitting.py file not parallel_fitting.py, so it should be fine? |
|
I am not the one you have to convince... |
|
Could you try explicitly re-exporting it ? diff --git a/astropy/modeling/fitting.py b/astropy/modeling/fitting.py
index 40f0bac01d..dee76ed6ce 100644
--- a/astropy/modeling/fitting.py
+++ b/astropy/modeling/fitting.py
@@ -33,7 +33,7 @@ import numpy as np
from astropy.units import Quantity
from astropy.utils.exceptions import AstropyUserWarning
-from ._fitting_parallel import parallel_fit_dask
+from ._fitting_parallel import parallel_fit_dask as parallel_fit_dask # noqa: PLC0414
from .optimizers import DEFAULT_ACC, DEFAULT_EPS, DEFAULT_MAXITER, SLSQP, Simplex
from .spline import (
SplineExactKnotsFitter, |
|
@neutrinoceros - no that didn't seem to work either. I've pushed a hack that does fix it. The issue is that sphinx-automodapi uses function.module to determine the fully qualified name of a function and excludes it by default if it is not local to the submodule being documented (which is sensible). @nstarman - this is going to be a major issue if we do use this pattern to make submodules private. Do you know of a way around it? |
|
This may be a configuration issue? I think Sphinx needs something like: |
|
I think the solution has to be different here because we are using sphinx-automodapi which lists the individual classes and functions. We usually don't have this issue when we import up one level, I think this is because it is a 'sideways' import. I wonder if it is a bug in sphinx-automodapi's smart_resolver, will investigate. |
|
Working on it in astropy/sphinx-automodapi#190 |
|
Ok so astropy/sphinx-automodapi#190 should fix this, would appreciate some reviews of that PR, then I can release a new version of sphinx-automodapi and try it here. |
…ask is imported from fitting.py
for more information, see https://pre-commit.ci
346705e to
4f5e09f
Compare
|
Triggering a new build to pick up sphinx-automodapi v0.18.0 |
|
Seems to work! 🎉 |
Although we haven't really reached a consensus on the public API APE, we might as well make this new file private by default since it isn't meant to be used directly.
Blocked by