labthings-fastapi is a reasonably large library divided into many different files. This however means that using labthings-fastapi tends to include mega import blocks like:

This is has a few issues:
- Imports get large and scary
- In the rest of the code it is not clear what functions come directly from
labthings-fastapi without going looking
- Anyone using
labthings-fastapi but lookup/remember the file structure to get to commonly used functionality
- If
labthings-fastapi changes its internal structure, the public API changes too
In contrast:
is very clean, exposes a huge amount of functionality, and all of that functionality is clearly from NumPy as each command starts with np.
Proposal
Pick the most core functionality and expose it with __all__ from __init__.py. So that it is possible to import with the line
import labthings-fastapi as lt
This should allow the user to access:
lt.Thing
lt.thing_action
lt.thing_property
lt.GetThingStates
lt.BlockingPortal
lt.BlockingPortal
lt.direct_thing_client_dependency
lt.raw_thing_dependency
lt.InvocationLogger
lt.MJPEGStreamDescriptor
lt.Blob
lt.NDArray
This would simplify the examples as for some of the examples the import lines are about 40% of the examples. Also if this syntax is used in testing it will make it clear whether the public API has changed when reorganising the underlying file structure.
labthings-fastapiis a reasonably large library divided into many different files. This however means that usinglabthings-fastapitends to include mega import blocks like:This is has a few issues:
labthings-fastapiwithout going lookinglabthings-fastapibut lookup/remember the file structure to get to commonly used functionalitylabthings-fastapichanges its internal structure, the public API changes tooIn contrast:
is very clean, exposes a huge amount of functionality, and all of that functionality is clearly from NumPy as each command starts with
np.Proposal
Pick the most core functionality and expose it with
__all__from__init__.py. So that it is possible to import with the lineimport labthings-fastapi as ltThis should allow the user to access:
lt.Thinglt.thing_actionlt.thing_propertylt.GetThingStateslt.BlockingPortallt.BlockingPortallt.direct_thing_client_dependencylt.raw_thing_dependencylt.InvocationLoggerlt.MJPEGStreamDescriptorlt.Bloblt.NDArrayThis would simplify the examples as for some of the examples the import lines are about 40% of the examples. Also if this syntax is used in testing it will make it clear whether the public API has changed when reorganising the underlying file structure.