Open whitews opened 2 years ago
Thanks for the bug report. I'm not immediately sure what's causing the problem, since it seems like the code already trying to do the right thing: import flowkit.gates
via importlib.import_module
(which should behave identically to import flowkit.gates
).
Can you double-check that sys.path
is set correctly? I found the FlowKit github repo and took a look at conf.py
. The sys.path.insert(0, os.path.abspath('../..'))
approach is fragile, since it's relative to the directory that sphinx is invoked from. Better would be to (i) install flowkit
using pip and not change sys.path
at all or (ii) configure sys.path
relative to __file__
, e.g. sys.path.insert(os.path.dirname(os.path.dirname(__file__)))
or similar.
Let me know if either of those approaches solve the problem, otherwise I'll look into this more over the weekend.
Completely unrelated to this issue, I have a library that I use for flow cytometry analysis that I want to shamelessly plugbring to your attention, since it seems complementary to FlowKit and might be useful to you. It's called wellmap, and it's basically a simple text file format that allows you to describe which experimental conditions are tested in which wells of a microplate. It's very useful for writing analysis scripts (such as those using FlowKit) that aren't tied to one specific plate layout.
It's a small world! I starred wellmap and will check it out.
I also questioned whether that janky sys path business could be the culprit. I just changed my local version to insert os.path.dirname(os.path.dirname(__file__))
but got the same error. Another odd thing is there doesn't seem to be any autoclasstoc code referenced in the stack trace, but maybe there are callbacks in the inner workings of sphinx.
I know! As soon as I saw flowkit.gates
, I was thinking "that sounds like a flow cytometry library!". It looks nice, too, I'll give it a try the next time I have flow data to analyze.
Anyways, I'll have to take a closer look at this bug. The stack trace you copied above has two autoclasstoc lines right at the end, so I don't think there's anything odd in that respect.
Hi Kale,
Thanks for your work on this project, I find it very useful for documenting large classes.
I have a project where, via
__init__
files, the qualified names differ from the file path for files containing some class definitions. When I try to add.. autoclasstoc::
to an existing RST doc (that successfully builds prior to adding), I get aModuleNotFound
error. For example, I have aRectangleGate
class that has the qualified pathflowkit.gates.RectangleGate
and would be imported like:from flowkit.gates import RectangleGate
but the actual file path to the module where the class is defined is:
flowkit/_models/gates/_gates.py
This was a working docs build prior to adding the autoclasstoc line for this class. The RST file that triggers the error:
Full stack trace: