InvokeAI/tests
psychedelicious 402cf9b0ee feat: refactor services folder/module structure
Refactor services folder/module structure.

**Motivation**

While working on our services I've repeatedly encountered circular imports and a general lack of clarity regarding where to put things. The structure introduced goes a long way towards resolving those issues, setting us up for a clean structure going forward.

**Services**

Services are now in their own folder with a few files:

- `services/{service_name}/__init__.py`: init as needed, mostly empty now
- `services/{service_name}/{service_name}_base.py`: the base class for the service
- `services/{service_name}/{service_name}_{impl_type}.py`: the default concrete implementation of the service - typically one of `sqlite`, `default`, or `memory`
- `services/{service_name}/{service_name}_common.py`: any common items - models, exceptions, utilities, etc

Though it's a bit verbose to have the service name both as the folder name and the prefix for files, I found it is _extremely_ confusing to have all of the base classes just be named `base.py`. So, at the cost of some verbosity when importing things, I've included the service name in the filename.

There are some minor logic changes. For example, in `InvocationProcessor`, instead of assigning the model manager service to a variable to be used later in the file, the service is used directly via the `Invoker`.

**Shared**

Things that are used across disparate services are in `services/shared/`:

- `default_graphs.py`: previously in `services/`
- `graphs.py`: previously in `services/`
- `paginatation`: generic pagination models used in a few services
- `sqlite`: the `SqliteDatabase` class, other sqlite-specific things
2023-10-12 12:15:06 -04:00
..
app Add support for T2I-Adapter in node workflows (#4612) 2023-10-05 16:29:16 +11:00
backend (minor) Fix Flake8. 2023-10-10 10:06:53 -04:00
inpainting Rename default schedulers across the app 2023-05-12 03:44:20 +12:00
nodes feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
test_model_manager prevent vae: '' from crashing model 2023-08-10 17:33:04 -04:00
test_model_probe/vae test(model management): test VaeFolderProbe 2023-09-20 12:48:59 -07:00
__init__.py parent 9eed1919c2 2023-02-24 18:57:02 -08:00
conftest.py Fix Flake8 errors by using a pytest conftest.py file. 2023-10-05 15:36:15 -04:00
dev_prompts.txt Added linux to the workflows (#463) 2022-09-16 17:46:57 -04:00
legacy_tests.sh Add back old dream.py as legacy_api.py 2022-10-12 20:35:56 -04:00
test_config.py add regression test 2023-09-21 12:43:34 -04:00
test_model_manager.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
test_model_probe.py lint 2023-09-20 12:53:25 -07:00
test_path.py isort wip 2023-09-12 13:01:58 -04:00
validate_pr_prompt.txt fixes to env parsing, textual inversion & help text 2023-05-18 10:48:23 -04:00