irie 0.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of irie might be problematic. Click here for more details.
- irie/__main__.py +24 -0
- irie/apps/__init__.py +5 -0
- irie/apps/authentication/__init__.py +1 -0
- irie/apps/authentication/admin.py +1 -0
- irie/apps/authentication/config.py +6 -0
- irie/apps/authentication/forms.py +41 -0
- irie/apps/authentication/migrations/__init__.py +1 -0
- irie/apps/authentication/models.py +1 -0
- irie/apps/authentication/tests.py +1 -0
- irie/apps/authentication/urls.py +9 -0
- irie/apps/authentication/views.py +53 -0
- irie/apps/config.py +8 -0
- irie/apps/context_processors.py +5 -0
- irie/apps/documents/__init__.py +0 -0
- irie/apps/documents/apps.py +7 -0
- irie/apps/documents/documents.py +61 -0
- irie/apps/documents/migrations/__init__.py +0 -0
- irie/apps/documents/tests.py +3 -0
- irie/apps/documents/urls.py +12 -0
- irie/apps/documents/views.py +27 -0
- irie/apps/evaluation/__init__.py +0 -0
- irie/apps/evaluation/admin.py +43 -0
- irie/apps/evaluation/apps.py +18 -0
- irie/apps/evaluation/daemon.py +107 -0
- irie/apps/evaluation/identification.py +196 -0
- irie/apps/evaluation/migrations/0001_initial.py +25 -0
- irie/apps/evaluation/migrations/0002_remove_evaluation_cesmd.py +17 -0
- irie/apps/evaluation/migrations/0003_evaluation_asset.py +20 -0
- irie/apps/evaluation/migrations/__init__.py +0 -0
- irie/apps/evaluation/models.py +72 -0
- irie/apps/evaluation/urls.py +16 -0
- irie/apps/evaluation/views.py +68 -0
- irie/apps/events/__init__.py +0 -0
- irie/apps/events/admin.py +9 -0
- irie/apps/events/apps.py +12 -0
- irie/apps/events/migrations/0001_initial.py +27 -0
- irie/apps/events/migrations/0002_alter_event_id.py +18 -0
- irie/apps/events/migrations/0003_event_cesmd.py +19 -0
- irie/apps/events/migrations/0004_event_record_identifier.py +19 -0
- irie/apps/events/migrations/0005_event_asset.py +21 -0
- irie/apps/events/migrations/0006_alter_event_event_file.py +18 -0
- irie/apps/events/migrations/__init__.py +0 -0
- irie/apps/events/models.py +70 -0
- irie/apps/events/tests.py +1 -0
- irie/apps/events/tests_events.py +240 -0
- irie/apps/events/urls.py +29 -0
- irie/apps/events/views.py +55 -0
- irie/apps/events/views_events.py +215 -0
- irie/apps/inventory/CESMD.py +81 -0
- irie/apps/inventory/__init__.py +5 -0
- irie/apps/inventory/admin.py +10 -0
- irie/apps/inventory/apps.py +12 -0
- irie/apps/inventory/archive/arcGIS.py +1175 -0
- irie/apps/inventory/calid.py +65 -0
- irie/apps/inventory/fields.py +5 -0
- irie/apps/inventory/forms.py +12 -0
- irie/apps/inventory/migrations/0001_initial.py +31 -0
- irie/apps/inventory/migrations/0002_assetevaluationmodel_cesmd.py +19 -0
- irie/apps/inventory/migrations/0003_auto_20230520_2030.py +23 -0
- irie/apps/inventory/migrations/0004_asset.py +27 -0
- irie/apps/inventory/migrations/0005_auto_20230731_1802.py +23 -0
- irie/apps/inventory/migrations/0006_auto_20230731_1816.py +28 -0
- irie/apps/inventory/migrations/0007_auto_20230731_1827.py +24 -0
- irie/apps/inventory/migrations/0008_asset_is_complete.py +19 -0
- irie/apps/inventory/migrations/0009_auto_20230731_1842.py +29 -0
- irie/apps/inventory/migrations/0010_auto_20230801_0025.py +23 -0
- irie/apps/inventory/migrations/0011_alter_asset_cgs_data.py +18 -0
- irie/apps/inventory/migrations/0012_corridor.py +22 -0
- irie/apps/inventory/migrations/0013_alter_asset_cesmd.py +18 -0
- irie/apps/inventory/migrations/0014_alter_asset_cesmd.py +18 -0
- irie/apps/inventory/migrations/__init__.py +0 -0
- irie/apps/inventory/models.py +70 -0
- irie/apps/inventory/tables.py +584 -0
- irie/apps/inventory/traffic.py +175052 -0
- irie/apps/inventory/urls.py +25 -0
- irie/apps/inventory/views.py +515 -0
- irie/apps/management/__init__.py +0 -0
- irie/apps/management/commands/__init__.py +0 -0
- irie/apps/networks/__init__.py +0 -0
- irie/apps/networks/apps.py +5 -0
- irie/apps/networks/forms.py +64 -0
- irie/apps/networks/migrations/0001_initial.py +26 -0
- irie/apps/networks/migrations/__init__.py +0 -0
- irie/apps/networks/models.py +14 -0
- irie/apps/networks/networks.py +782 -0
- irie/apps/networks/tests.py +1 -0
- irie/apps/networks/urls.py +18 -0
- irie/apps/networks/views.py +89 -0
- irie/apps/prediction/__init__.py +0 -0
- irie/apps/prediction/admin.py +9 -0
- irie/apps/prediction/apps.py +12 -0
- irie/apps/prediction/forms.py +20 -0
- irie/apps/prediction/metrics.py +61 -0
- irie/apps/prediction/migrations/0001_initial.py +32 -0
- irie/apps/prediction/migrations/0002_auto_20230731_1801.py +27 -0
- irie/apps/prediction/migrations/0003_rename_assetevaluationmodel_evaluation.py +18 -0
- irie/apps/prediction/migrations/0004_delete_evaluation.py +16 -0
- irie/apps/prediction/migrations/0005_predictormodel_protocol.py +18 -0
- irie/apps/prediction/migrations/0006_alter_predictormodel_protocol.py +18 -0
- irie/apps/prediction/migrations/0007_predictormodel_active.py +19 -0
- irie/apps/prediction/migrations/0008_predictormodel_description.py +18 -0
- irie/apps/prediction/migrations/0009_predictormodel_entry_point.py +19 -0
- irie/apps/prediction/migrations/0010_alter_predictormodel_entry_point.py +18 -0
- irie/apps/prediction/migrations/0011_remove_predictormodel_entry_point.py +17 -0
- irie/apps/prediction/migrations/0012_predictormodel_entry_point.py +18 -0
- irie/apps/prediction/migrations/0013_predictormodel_metrics.py +18 -0
- irie/apps/prediction/migrations/0014_auto_20240930_0004.py +28 -0
- irie/apps/prediction/migrations/0015_alter_predictormodel_render_file.py +18 -0
- irie/apps/prediction/migrations/__init__.py +0 -0
- irie/apps/prediction/models.py +37 -0
- irie/apps/prediction/predictor.py +286 -0
- irie/apps/prediction/runners/__init__.py +450 -0
- irie/apps/prediction/runners/metrics.py +168 -0
- irie/apps/prediction/runners/opensees/__init__.py +0 -0
- irie/apps/prediction/runners/opensees/schemas/__init__.py +39 -0
- irie/apps/prediction/runners/utilities.py +277 -0
- irie/apps/prediction/runners/xmlutils.py +232 -0
- irie/apps/prediction/runners/zipped.py +27 -0
- irie/apps/prediction/templatetags/__init__.py +0 -0
- irie/apps/prediction/templatetags/predictor.py +20 -0
- irie/apps/prediction/urls.py +19 -0
- irie/apps/prediction/views.py +184 -0
- irie/apps/prediction/views_api.py +216 -0
- irie/apps/site/__init__.py +0 -0
- irie/apps/site/admin.py +1 -0
- irie/apps/site/config.py +6 -0
- irie/apps/site/migrations/__init__.py +1 -0
- irie/apps/site/models.py +2 -0
- irie/apps/site/templatetags/__init__.py +0 -0
- irie/apps/site/templatetags/indexing.py +7 -0
- irie/apps/site/tests.py +1 -0
- irie/apps/site/urls.py +8 -0
- irie/apps/site/view_sdof.py +40 -0
- irie/apps/site/view_utils.py +13 -0
- irie/apps/site/views.py +88 -0
- irie/core/__init__.py +5 -0
- irie/core/asgi.py +12 -0
- irie/core/settings.py +223 -0
- irie/core/urls.py +39 -0
- irie/core/wsgi.py +12 -0
- irie-0.0.0.dist-info/METADATA +48 -0
- irie-0.0.0.dist-info/RECORD +145 -0
- irie-0.0.0.dist-info/WHEEL +5 -0
- irie-0.0.0.dist-info/entry_points.txt +2 -0
- irie-0.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from django.test import TestCase
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
#
|
|
7
|
+
# Fall 2024, BRACE2 Team
|
|
8
|
+
#
|
|
9
|
+
# Berkeley, CA
|
|
10
|
+
#
|
|
11
|
+
#----------------------------------------------------------------------------#
|
|
12
|
+
from django.urls import path
|
|
13
|
+
from apps.networks import views
|
|
14
|
+
|
|
15
|
+
urlpatterns = [
|
|
16
|
+
path("networks/", views.network_maps, name="networks"),
|
|
17
|
+
path("api/networks/", views.load_network_map, name='load_network_map'),
|
|
18
|
+
]
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
#
|
|
7
|
+
# Fall 2024, BRACE2 Team
|
|
8
|
+
# Berkeley, CA
|
|
9
|
+
#
|
|
10
|
+
#----------------------------------------------------------------------------#
|
|
11
|
+
|
|
12
|
+
import os
|
|
13
|
+
import json
|
|
14
|
+
from django.template import loader
|
|
15
|
+
from django.contrib.auth.decorators import login_required
|
|
16
|
+
from django.http import HttpRequest, HttpResponse
|
|
17
|
+
import logging
|
|
18
|
+
from .models import UserNetworkPreferences
|
|
19
|
+
|
|
20
|
+
logger = logging.getLogger(__name__)
|
|
21
|
+
|
|
22
|
+
from .networks import BridgeNetworks_method_a, BridgeNetworks_method_b, BridgeNetworks_method_b_alt
|
|
23
|
+
|
|
24
|
+
from .forms import CorridorsForm
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@login_required(login_url="/login/")
|
|
28
|
+
def load_network_map(request: HttpRequest)->HttpResponse:
|
|
29
|
+
|
|
30
|
+
preferences, created = UserNetworkPreferences.objects.get_or_create(user=request.user)
|
|
31
|
+
|
|
32
|
+
tab = request.GET.get('tab', None)
|
|
33
|
+
|
|
34
|
+
form = CorridorsForm(request.GET or None)
|
|
35
|
+
#
|
|
36
|
+
#
|
|
37
|
+
if not form.is_valid():
|
|
38
|
+
return HttpResponse(json.dumps({"map_html": '<p>Invalid inputs.</p>'}))
|
|
39
|
+
|
|
40
|
+
method = form.cleaned_data["method"]
|
|
41
|
+
weights = {k: v for k,v in form.cleaned_data.items() if k.endswith("_weight")}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if method == 0:
|
|
45
|
+
Analysis = BridgeNetworks_method_a
|
|
46
|
+
elif method == 1:
|
|
47
|
+
Analysis = BridgeNetworks_method_b
|
|
48
|
+
elif method == 2:
|
|
49
|
+
Analysis = BridgeNetworks_method_b_alt
|
|
50
|
+
else:
|
|
51
|
+
return HttpResponse(json.dumps({"map_html": '<p>Map unavailable.</p>'}))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
data = {}
|
|
55
|
+
if tab != "tab1":
|
|
56
|
+
analysis = Analysis(preferences, weights, False, True)
|
|
57
|
+
map = analysis.create_map(corridor=form.cleaned_data["corridor_input"])
|
|
58
|
+
|
|
59
|
+
else:
|
|
60
|
+
cp = form.cleaned_data["consider_population"]
|
|
61
|
+
analysis = Analysis(preferences, weights, cp, False)
|
|
62
|
+
map = analysis.create_map()
|
|
63
|
+
data["table_html"] = loader.get_template("networks/corridor_table.html").render({
|
|
64
|
+
"corridors": (i for _, i in analysis.ranked_corridors().iterrows())
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
data["map_html"] = map._repr_html_()
|
|
68
|
+
return HttpResponse(json.dumps(data))
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@login_required(login_url="/login/")
|
|
72
|
+
def network_maps(request: HttpRequest)->HttpResponse:
|
|
73
|
+
|
|
74
|
+
context = {}
|
|
75
|
+
context["segment"] = "networks"
|
|
76
|
+
|
|
77
|
+
context["maps"] = {
|
|
78
|
+
"tab1": {"name": "All", "form": CorridorsForm()},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
html_template = loader.get_template("networks/networks.html")
|
|
83
|
+
return HttpResponse(html_template.render(context, request))
|
|
84
|
+
|
|
85
|
+
except Exception as e:
|
|
86
|
+
if "DEBUG" in os.environ and os.environ["DEBUG"]:
|
|
87
|
+
raise e
|
|
88
|
+
html_template = loader.get_template("site/page-500.html")
|
|
89
|
+
return HttpResponse(html_template.render(context, request))
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
from django.contrib import admin
|
|
7
|
+
from .models import PredictorModel
|
|
8
|
+
|
|
9
|
+
admin.site.register(PredictorModel)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
from django.apps import AppConfig
|
|
7
|
+
|
|
8
|
+
class PredictionConfig(AppConfig):
|
|
9
|
+
default_auto_field = 'django.db.models.BigAutoField'
|
|
10
|
+
name = 'apps.prediction'
|
|
11
|
+
label = 'apps_prediction'
|
|
12
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
from django import forms
|
|
7
|
+
from apps.prediction.models import PredictorModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# class CsiForm(forms.Form):
|
|
11
|
+
# option1 = forms.CharField(label='Option 1', max_length=100)
|
|
12
|
+
# option2 = forms.CharField(label='Option 2', max_length=100)
|
|
13
|
+
# file_upload = forms.FileField(label='Upload a file', required=True)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class PredictorForm(forms.ModelForm):
|
|
17
|
+
class Meta:
|
|
18
|
+
model = PredictorModel
|
|
19
|
+
fields = '__all__'
|
|
20
|
+
exclude = ['render_file', 'metrics', 'active', 'entry_point', 'config', 'protocol']
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
import orjson
|
|
7
|
+
|
|
8
|
+
def _serialize(data):
|
|
9
|
+
return orjson.loads(orjson.dumps(data,
|
|
10
|
+
option=orjson.OPT_SERIALIZE_NUMPY))
|
|
11
|
+
|
|
12
|
+
class HealthMetric:
|
|
13
|
+
metric_tag: str
|
|
14
|
+
def __init__(self, predictor: str, data = None):
|
|
15
|
+
self.predictor = predictor
|
|
16
|
+
self.data = data
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class PeriodShiftMetric(HealthMetric):
|
|
20
|
+
metric_tag = "SPECTRAL_SHIFT_IDENTIFICATION"
|
|
21
|
+
def buildDetails(self):
|
|
22
|
+
return self.data
|
|
23
|
+
def getSummary(self):
|
|
24
|
+
return self.data
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ColumnStrainStateMetric01(HealthMetric):
|
|
29
|
+
metric_tag = "COLUMN_STRAIN_STATES"
|
|
30
|
+
|
|
31
|
+
def format_html(self):
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
class PeakAccelMetric01(HealthMetric):
|
|
35
|
+
metric_tag = "PEAK_ACCEL"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class PeakDriftMetric01(HealthMetric):
|
|
39
|
+
metric_tag = "PEAK_DRIFT"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class AccelRHMetric01(HealthMetric):
|
|
43
|
+
metric_tag = "ACC_RESPONSE_HISTORY"
|
|
44
|
+
|
|
45
|
+
def getSummary(self)->dict:
|
|
46
|
+
return _serialize(self.data)
|
|
47
|
+
|
|
48
|
+
def buildDetails(self)->str:
|
|
49
|
+
return _serialize(self.data)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
METRIC_CLASSES = {
|
|
53
|
+
c.metric_tag: c for c in [
|
|
54
|
+
PeriodShiftMetric,
|
|
55
|
+
PeakAccelMetric01,
|
|
56
|
+
PeakDriftMetric01,
|
|
57
|
+
AccelRHMetric01,
|
|
58
|
+
ColumnStrainStateMetric01
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-05-20 20:30
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
initial = True
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
('apps_events', '0003_event_cesmd'),
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
operations = [
|
|
16
|
+
migrations.CreateModel(
|
|
17
|
+
name='AssetModel',
|
|
18
|
+
fields=[
|
|
19
|
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
|
20
|
+
('cesmd', models.CharField(max_length=7)),
|
|
21
|
+
],
|
|
22
|
+
),
|
|
23
|
+
migrations.CreateModel(
|
|
24
|
+
name='AssetEvaluationModel',
|
|
25
|
+
fields=[
|
|
26
|
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
|
27
|
+
('cesmd', models.CharField(max_length=7)),
|
|
28
|
+
('evaluation_data', models.JSONField(default=dict)),
|
|
29
|
+
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='apps_events.event')),
|
|
30
|
+
],
|
|
31
|
+
),
|
|
32
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-07-31 18:01
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
('apps_inventory', '0004_asset'),
|
|
11
|
+
('apps_prediction', '0001_initial'),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
operations = [
|
|
15
|
+
migrations.CreateModel(
|
|
16
|
+
name='PredictorModel',
|
|
17
|
+
fields=[
|
|
18
|
+
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
|
19
|
+
('config', models.JSONField(default=dict)),
|
|
20
|
+
('name', models.CharField(max_length=35)),
|
|
21
|
+
('asset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='apps_inventory.asset')),
|
|
22
|
+
],
|
|
23
|
+
),
|
|
24
|
+
migrations.DeleteModel(
|
|
25
|
+
name='AssetModel',
|
|
26
|
+
),
|
|
27
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-07-31 18:06
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_events', '0004_event_record_identifier'),
|
|
10
|
+
('apps_prediction', '0002_auto_20230731_1801'),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.RenameModel(
|
|
15
|
+
old_name='AssetEvaluationModel',
|
|
16
|
+
new_name='Evaluation',
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-08-07 19:20
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0003_rename_assetevaluationmodel_evaluation'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.DeleteModel(
|
|
14
|
+
name='Evaluation',
|
|
15
|
+
),
|
|
16
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-17 22:39
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0004_delete_evaluation'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='protocol',
|
|
16
|
+
field=models.CharField(choices=[('T1', 'Type1'), ('T2', 'Type2')], default='T2', max_length=2),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 00:12
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0005_predictormodel_protocol'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='protocol',
|
|
16
|
+
field=models.CharField(choices=[('BRACE2_CLI_PREDICTOR_V1', 'Type1'), ('BRACE2_CLI_PREDICTOR_T2', 'Type2'), ('BRACE2_CLI_PREDICTOR_T3', 'Type3')], default='BRACE2_CLI_PREDICTOR_T2', max_length=25),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 00:17
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0006_alter_predictormodel_protocol'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='active',
|
|
16
|
+
field=models.BooleanField(default=True),
|
|
17
|
+
preserve_default=False,
|
|
18
|
+
),
|
|
19
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 00:55
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0007_predictormodel_active'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='description',
|
|
16
|
+
field=models.TextField(default=''),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 01:04
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0008_predictormodel_description'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='entry_point',
|
|
16
|
+
field=models.CharField(default='', max_length=100),
|
|
17
|
+
preserve_default=False,
|
|
18
|
+
),
|
|
19
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 01:10
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0009_predictormodel_entry_point'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='entry_point',
|
|
16
|
+
field=models.JSONField(default=list),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 01:11
|
|
2
|
+
|
|
3
|
+
from django.db import migrations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0010_alter_predictormodel_entry_point'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.RemoveField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='entry_point',
|
|
16
|
+
),
|
|
17
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 01:12
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0011_remove_predictormodel_entry_point'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='entry_point',
|
|
16
|
+
field=models.JSONField(default=list),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2023-12-18 01:20
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0012_predictormodel_entry_point'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='metrics',
|
|
16
|
+
field=models.JSONField(default=list),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated by Django 3.2.13 on 2024-09-30 00:04
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0013_predictormodel_metrics'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='config_file',
|
|
16
|
+
field=models.FileField(blank=True, null=True, upload_to='predictor_configs/'),
|
|
17
|
+
),
|
|
18
|
+
migrations.AddField(
|
|
19
|
+
model_name='predictormodel',
|
|
20
|
+
name='render_file',
|
|
21
|
+
field=models.FileField(blank=True, null=True, upload_to='predictor_configs/'),
|
|
22
|
+
),
|
|
23
|
+
migrations.AlterField(
|
|
24
|
+
model_name='predictormodel',
|
|
25
|
+
name='protocol',
|
|
26
|
+
field=models.CharField(choices=[('BRACE2_CLI_PREDICTOR_V1', 'Type1'), ('BRACE2_CLI_PREDICTOR_T2', 'Type2'), ('BRACE2_CLI_PREDICTOR_T3', 'Type3'), ('BRACE2_CLI_PREDICTOR_T4', 'Type4')], default='BRACE2_CLI_PREDICTOR_T2', max_length=25),
|
|
27
|
+
),
|
|
28
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 5.1 on 2024-11-03 00:27
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('apps_prediction', '0014_auto_20240930_0004'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AlterField(
|
|
14
|
+
model_name='predictormodel',
|
|
15
|
+
name='render_file',
|
|
16
|
+
field=models.FileField(blank=True, null=True, upload_to='renderings/'),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#===----------------------------------------------------------------------===#
|
|
2
|
+
#
|
|
3
|
+
# STAIRLab -- STructural Artificial Intelligence Laboratory
|
|
4
|
+
#
|
|
5
|
+
#===----------------------------------------------------------------------===#
|
|
6
|
+
from django.db import models
|
|
7
|
+
|
|
8
|
+
from apps.inventory.models import Asset
|
|
9
|
+
|
|
10
|
+
class PredictorModel(models.Model):
|
|
11
|
+
# https://docs.djangoproject.com/en/4.2/ref/models/fields/
|
|
12
|
+
class Protocol(models.TextChoices):
|
|
13
|
+
TYPE1 = "BRACE2_CLI_PREDICTOR_V1"
|
|
14
|
+
TYPE2 = "BRACE2_CLI_PREDICTOR_T2"
|
|
15
|
+
TYPE3 = "BRACE2_CLI_PREDICTOR_T3"
|
|
16
|
+
TYPE4 = "BRACE2_CLI_PREDICTOR_T4"
|
|
17
|
+
|
|
18
|
+
id = models.BigAutoField(primary_key=True)
|
|
19
|
+
name = models.CharField(max_length=35)
|
|
20
|
+
asset = models.ForeignKey(Asset, on_delete=models.CASCADE)
|
|
21
|
+
description = models.TextField(default="")
|
|
22
|
+
|
|
23
|
+
protocol = models.CharField(max_length=25,
|
|
24
|
+
choices=Protocol.choices,
|
|
25
|
+
default=Protocol.TYPE2)
|
|
26
|
+
|
|
27
|
+
entry_point = models.JSONField(default=list)
|
|
28
|
+
config = models.JSONField(default=dict)
|
|
29
|
+
config_file = models.FileField(upload_to='predictor_configs/', null=True, blank=True)
|
|
30
|
+
render_file = models.FileField(upload_to='renderings/', null=True, blank=True)
|
|
31
|
+
metrics = models.JSONField(default=list)
|
|
32
|
+
|
|
33
|
+
active = models.BooleanField()
|
|
34
|
+
|
|
35
|
+
def __str__(self):
|
|
36
|
+
return f"{self.asset.calid} - {self.name} : {self.description}"
|
|
37
|
+
|