diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py index f79c140e248d275df2d883cf01c9fa7737509662..7d875948fa4ec0ae81dfbd3c7c1e975d4a9a7b64 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/populate.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/populate.py @@ -141,33 +141,33 @@ def populate_cycles(apps, schema_editor): models.CycleQuota.objects.bulk_create([models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time"), + name="LOFAR Observing Time"), value=0.8 * cycle.duration.total_seconds()), # rough guess. 80% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="cep_processing_time"), + name="CEP Processing Time"), value=0.8 * cycle.duration.total_seconds()), models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="lta_storage"), + resource_type=ResourceType.objects.get(name="LTA Storage"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="support_time"), + name="LOFAR Support Time"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_commissioning"), + name="LOFAR Observing Time Commissioning"), value=0.05 * cycle.duration.total_seconds()), # rough guess. 5% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_a"), + name="LOFAR Observing Time prio A"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_b"), + name="LOFAR Observing Time prio B"), value=0) # needs to be filled in by user (SOS) ]) @@ -179,26 +179,26 @@ def populate_cycles(apps, schema_editor): stop=datetime(2013+(nr+1)//2, 5 if nr%2==1 else 11, 14, 0, 0, 0, 0, tzinfo=timezone.utc)) models.CycleQuota.objects.bulk_create([models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="observing_time"), + resource_type=ResourceType.objects.get(name="LOFAR Observing Time"), value=0.8*cycle.duration.total_seconds()), # rough guess. 80% of total time available for observing models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="cep_processing_time"), + resource_type=ResourceType.objects.get(name="CEP Processing Time"), value=0.8*cycle.duration.total_seconds()), models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="lta_storage"), + resource_type=ResourceType.objects.get(name="LTA Storage"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="support_time"), + resource_type=ResourceType.objects.get(name="LOFAR Support Time"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="observing_time_commissioning"), + resource_type=ResourceType.objects.get(name="LOFAR Observing Time Commissioning"), value=0.05*cycle.duration.total_seconds()), # rough guess. 5% of total time available for observing models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="observing_time_prio_a"), + resource_type=ResourceType.objects.get(name="LOFAR Observing Time prio A"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, - resource_type=ResourceType.objects.get(name="observing_time_prio_b"), + resource_type=ResourceType.objects.get(name="LOFAR Observing Time prio B"), value=0) # needs to be filled in by user (SOS) ]) @@ -210,34 +210,34 @@ def populate_cycles(apps, schema_editor): models.CycleQuota.objects.bulk_create([models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time"), + name="LOFAR Observing Time"), value=0.8 * cycle.duration.total_seconds()), # rough guess. 80% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="cep_processing_time"), + name="CEP Processing Time"), value=0.8 * cycle.duration.total_seconds()), models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="lta_storage"), + name="LTA Storage"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="support_time"), + name="LOFAR Support Time"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_commissioning"), + name="LOFAR Observing Time Commissioning"), value=0.05 * cycle.duration.total_seconds()), # rough guess. 5% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_a"), + name="LOFAR Observing Time prio A"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_b"), + name="LOFAR Observing Time prio B"), value=0) # needs to be filled in by user (SOS) ]) @@ -253,34 +253,34 @@ def populate_cycles(apps, schema_editor): models.CycleQuota.objects.bulk_create([models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time"), + name="LOFAR Observing Time"), value=0.8 * cycle.duration.total_seconds()), # rough guess. 80% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="cep_processing_time"), + name="CEP Processing Time"), value=0.8 * cycle.duration.total_seconds()), models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="lta_storage"), + name="LTA Storage"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="support_time"), + name="LOFAR Support Time"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_commissioning"), + name="LOFAR Observing Time Commissioning"), value=0.05 * cycle.duration.total_seconds()), # rough guess. 5% of total time available for observing models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_a"), + name="LOFAR Observing Time prio A"), value=0), # needs to be filled in by user (SOS) models.CycleQuota(cycle=cycle, resource_type=ResourceType.objects.get( - name="observing_time_prio_b"), + name="LOFAR Observing Time prio B"), value=0) # needs to be filled in by user (SOS) ]) @@ -303,7 +303,7 @@ def populate_projects(apps, schema_editor): # for convenience, create a schedulingset for each project models.SchedulingSet.objects.create(**SchedulingSet_test_data(name="Test Scheduling Set", project=tmss_project)) - project_quota = ProjectQuota.objects.create(project=tmss_project, value=1e12, resource_type=ResourceType.objects.get(name="lta_storage")) + project_quota = ProjectQuota.objects.create(project=tmss_project, value=1e12, resource_type=ResourceType.objects.get(name="LTA Storage")) sara_fs = Filesystem.objects.get(name="Lofar Storage (SARA)") models.ProjectQuotaArchiveLocation.objects.create(project_quota=project_quota, archive_location=sara_fs) @@ -313,18 +313,7 @@ def populate_resources(apps, schema_editor): time_q = Quantity.objects.get(value=Quantity.Choices.TIME.value) number_q = Quantity.objects.get(value=Quantity.Choices.NUMBER.value) - ResourceType.objects.bulk_create([ResourceType(name="lta_storage", description="Amount of storage in the LTA (in bytes)", quantity=bytes_q), - ResourceType(name="cep_storage", description="Amount of storage on the CEP processing cluster (in bytes)", quantity=bytes_q), - ResourceType(name="cep_processing_time", description="Processing time on the CEP processing cluster (in seconds)", quantity=time_q), - ResourceType(name="observing_time", description="Observing time (in seconds)", quantity=time_q), - ResourceType(name="observing_time_prio_a", description="Observing time with priority A (in seconds)", quantity=time_q), - ResourceType(name="observing_time_prio_b", description="Observing time with priority B (in seconds)", quantity=time_q), - ResourceType(name="observing_time_commissioning", description="Observing time for Commissioning/DDT (in seconds)", quantity=time_q), - ResourceType(name="support_time", description="Support time by human (in seconds)", quantity=time_q), - ResourceType(name="number_of_triggers", description="Number of trigger events (as integer)", quantity=number_q), - # TODO these duplicates have names that front-end expects. - # TODO We should not have doubles. - ResourceType(name="LTA Storage", description="Amount of storage in the LTA (in bytes)", quantity=bytes_q), + ResourceType.objects.bulk_create([ResourceType(name="LTA Storage", description="Amount of storage in the LTA (in bytes)", quantity=bytes_q), ResourceType(name="CEP Storage", description="Amount of storage on the CEP processing cluster (in bytes)", quantity=bytes_q), ResourceType(name="CEP Processing Time", description="Processing time on the CEP processing cluster (in seconds)", quantity=time_q), ResourceType(name="LOFAR Observing Time", description="Observing time (in seconds)", quantity=time_q),