f20080305d
Определение специфических рекомендаций (матрица профилей §8):
1. Ж/д слой (закрыт мёртвый railway ×2.5 у РАС):
- /api/v1/water/{case_id} отдаёт railway=rail как LineString
(без service/industrial/military веток), кэш общий v2;
- railway_warning «перекрыть/проверить немедленно» по профилям;
- SearchMap: Polyline слой ж/д (тёмно-красный), счётчики 💧/🚂.
2. cant_swim → профиль не_умеет_плавать (water ×3.0, без изменения
радиуса, critical_warning «обследовать водоёмы НЕМЕДЛЕННО»):
- раньше чекбокс влиял только на текст, в скоринге был пробел;
- derive в analyze._derive_profiles — работает и для closed_cases.
3. unmodeled_profiles: ДЦП/слабое зрение/слух — честная пометка
«вне поведенческой модели» с пояснением (vector_tasks B12:
профили без аналога не выдавать за учтённые); блок на фронте
в карточке здоровья.
Площадь воды: сферический эксцесс, проверен на квадрате 53° (744017 м²
vs 743272 точного). Тесты: 202 passed (новый test_cant_swim_profile).
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
# testing/plugin/bootstrap.py
|
|
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
# <see AUTHORS file>
|
|
#
|
|
# This module is part of SQLAlchemy and is released under
|
|
# the MIT License: https://www.opensource.org/licenses/mit-license.php
|
|
# mypy: ignore-errors
|
|
|
|
"""
|
|
Bootstrapper for test framework plugins.
|
|
|
|
The entire rationale for this system is to get the modules in plugin/
|
|
imported without importing all of the supporting library, so that we can
|
|
set up things for testing before coverage starts.
|
|
|
|
The rationale for all of plugin/ being *in* the supporting library in the
|
|
first place is so that the testing and plugin suite is available to other
|
|
libraries, mainly external SQLAlchemy and Alembic dialects, to make use
|
|
of the same test environment and standard suites available to
|
|
SQLAlchemy/Alembic themselves without the need to ship/install a separate
|
|
package outside of SQLAlchemy.
|
|
|
|
|
|
"""
|
|
|
|
import importlib.util
|
|
import os
|
|
import sys
|
|
|
|
bootstrap_file = locals()["bootstrap_file"]
|
|
to_bootstrap = locals()["to_bootstrap"]
|
|
|
|
|
|
def load_file_as_module(name):
|
|
path = os.path.join(os.path.dirname(bootstrap_file), "%s.py" % name)
|
|
|
|
spec = importlib.util.spec_from_file_location(name, path)
|
|
assert spec is not None
|
|
assert spec.loader is not None
|
|
mod = importlib.util.module_from_spec(spec)
|
|
spec.loader.exec_module(mod)
|
|
return mod
|
|
|
|
|
|
if to_bootstrap == "pytest":
|
|
sys.modules["sqla_plugin_base"] = load_file_as_module("plugin_base")
|
|
sys.modules["sqla_plugin_base"].bootstrapped_as_sqlalchemy = True
|
|
sys.modules["sqla_pytestplugin"] = load_file_as_module("pytestplugin")
|
|
else:
|
|
raise Exception("unknown bootstrap: %s" % to_bootstrap) # noqa
|