refactor: Storage 改用工厂模式,server reload 接入 uvicorn

- 新增 StorageFactory(BaseFactory[BaseStorage]) 替代手写 dict 注册
- H5Storage / JSONStorage 通过 @StorageFactory.register 注册
- dataset.py 使用 StorageFactory.create() 替代 create_storage()
- 删除 create_storage / available_storage_types 死函数
- server.py reload 参数正式传入 uvicorn.run()
This commit is contained in:
2026-05-16 17:00:26 +08:00
parent 48a53121ba
commit 04c0dc7a47
5 changed files with 30 additions and 42 deletions
+2 -4
View File
@@ -9,8 +9,7 @@ from astrai.dataset.storage import (
H5Storage,
JSONStorage,
MultiSegmentFetcher,
available_storage_types,
create_storage,
StorageFactory,
detect_format,
load_h5,
load_json,
@@ -26,9 +25,8 @@ __all__ = [
"BaseStorage",
"H5Storage",
"JSONStorage",
"create_storage",
"StorageFactory",
"detect_format",
"available_storage_types",
"save_h5",
"load_h5",
"save_json",