From 96148bac02cfebc12c331076d96f3bf98f03ebc4 Mon Sep 17 00:00:00 2001 From: tyrin Date: Tue, 10 Sep 2024 14:59:39 +0300 Subject: [PATCH] rename application to GaiaDBInterface --- {sample_app => GaiaDBInterface}/__init__.py | 0 {sample_app => GaiaDBInterface}/admin.py | 0 {sample_app => GaiaDBInterface}/apps.py | 2 +- .../management/__init__.py | 0 .../management/commands/__init__.py | 0 .../management/commands/ingester.py | 2 +- .../migrations/__init__.py | 0 {sample_app => GaiaDBInterface}/models.py | 0 {sample_app => GaiaDBInterface}/tests.py | 0 {sample_app => GaiaDBInterface}/urls.py | 0 {sample_app => GaiaDBInterface}/views.py | 0 create_model.ipynb | 9 ++++ gaia_orm/settings.py | 2 +- sample_app/migrations/0001_initial.py | 48 ------------------- 14 files changed, 12 insertions(+), 51 deletions(-) rename {sample_app => GaiaDBInterface}/__init__.py (100%) rename {sample_app => GaiaDBInterface}/admin.py (100%) rename {sample_app => GaiaDBInterface}/apps.py (81%) rename {sample_app => GaiaDBInterface}/management/__init__.py (100%) rename {sample_app => GaiaDBInterface}/management/commands/__init__.py (100%) rename {sample_app => GaiaDBInterface}/management/commands/ingester.py (99%) rename {sample_app => GaiaDBInterface}/migrations/__init__.py (100%) rename {sample_app => GaiaDBInterface}/models.py (100%) rename {sample_app => GaiaDBInterface}/tests.py (100%) rename {sample_app => GaiaDBInterface}/urls.py (100%) rename {sample_app => GaiaDBInterface}/views.py (100%) delete mode 100644 sample_app/migrations/0001_initial.py diff --git a/sample_app/__init__.py b/GaiaDBInterface/__init__.py similarity index 100% rename from sample_app/__init__.py rename to GaiaDBInterface/__init__.py diff --git a/sample_app/admin.py b/GaiaDBInterface/admin.py similarity index 100% rename from sample_app/admin.py rename to GaiaDBInterface/admin.py diff --git a/sample_app/apps.py b/GaiaDBInterface/apps.py similarity index 81% rename from sample_app/apps.py rename to GaiaDBInterface/apps.py index 8887c60..9276ddd 100644 --- a/sample_app/apps.py +++ b/GaiaDBInterface/apps.py @@ -3,4 +3,4 @@ from django.apps import AppConfig class SampleAppConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' - name = 'sample_app' + name = 'GaiaDBInterface' diff --git a/sample_app/management/__init__.py b/GaiaDBInterface/management/__init__.py similarity index 100% rename from sample_app/management/__init__.py rename to GaiaDBInterface/management/__init__.py diff --git a/sample_app/management/commands/__init__.py b/GaiaDBInterface/management/commands/__init__.py similarity index 100% rename from sample_app/management/commands/__init__.py rename to GaiaDBInterface/management/commands/__init__.py diff --git a/sample_app/management/commands/ingester.py b/GaiaDBInterface/management/commands/ingester.py similarity index 99% rename from sample_app/management/commands/ingester.py rename to GaiaDBInterface/management/commands/ingester.py index 59d4857..713151d 100644 --- a/sample_app/management/commands/ingester.py +++ b/GaiaDBInterface/management/commands/ingester.py @@ -9,7 +9,7 @@ import pandas as pd import django from asgiref.sync import sync_to_async from django.core.management.base import BaseCommand -from sample_app.models import GaiaSource, CatalogFile +from GaiaDBInterface.models import GaiaSource, CatalogFile class Command(BaseCommand): diff --git a/sample_app/migrations/__init__.py b/GaiaDBInterface/migrations/__init__.py similarity index 100% rename from sample_app/migrations/__init__.py rename to GaiaDBInterface/migrations/__init__.py diff --git a/sample_app/models.py b/GaiaDBInterface/models.py similarity index 100% rename from sample_app/models.py rename to GaiaDBInterface/models.py diff --git a/sample_app/tests.py b/GaiaDBInterface/tests.py similarity index 100% rename from sample_app/tests.py rename to GaiaDBInterface/tests.py diff --git a/sample_app/urls.py b/GaiaDBInterface/urls.py similarity index 100% rename from sample_app/urls.py rename to GaiaDBInterface/urls.py diff --git a/sample_app/views.py b/GaiaDBInterface/views.py similarity index 100% rename from sample_app/views.py rename to GaiaDBInterface/views.py diff --git a/create_model.ipynb b/create_model.ipynb index 4192e97..eed4c30 100644 --- a/create_model.ipynb +++ b/create_model.ipynb @@ -1,5 +1,14 @@ { "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## This is a prototype way to create models on the fly using pandas as the type parser.\n", + "### It was phased out in favor of creating models manually to avoid any mistakes pandas could make. \n", + "### However it is kept here for just in case." + ] + }, { "cell_type": "markdown", "metadata": {}, diff --git a/gaia_orm/settings.py b/gaia_orm/settings.py index 7c4cd33..f081b1c 100644 --- a/gaia_orm/settings.py +++ b/gaia_orm/settings.py @@ -31,7 +31,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ - 'sample_app', + 'GaiaDBInterface', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/sample_app/migrations/0001_initial.py b/sample_app/migrations/0001_initial.py deleted file mode 100644 index ec2d4bf..0000000 --- a/sample_app/migrations/0001_initial.py +++ /dev/null @@ -1,48 +0,0 @@ -# Generated by Django 5.1.1 on 2024-09-10 11:15 - -import django.db.models.deletion -import uuid -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='CatalogFile', - fields=[ - ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('name', models.CharField(max_length=32)), - ('status', models.CharField(choices=[('PENDING', 'Pending'), ('IN_PROGRESS', 'In Progress'), ('INGESTED', 'Ingested'), ('INDEXED', 'Indexed')], default='PENDING', max_length=11)), - ], - ), - migrations.CreateModel( - name='GaiaSource', - fields=[ - ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), - ('solution_id', models.CharField(blank=True, default='', max_length=19)), - ('designation', models.CharField(blank=True, default='', max_length=30)), - ('source_id', models.CharField(blank=True, default='', max_length=19)), - ('ref_epoch', models.FloatField(default=0.0, null=True)), - ('ra', models.FloatField(default=0.0, null=True)), - ('ra_error', models.FloatField(default=0.0, null=True)), - ('dec', models.FloatField(default=0.0, null=True)), - ('dec_error', models.FloatField(default=0.0, null=True)), - ('parallax', models.FloatField(default=0.0, null=True)), - ('parallax_error', models.FloatField(default=0.0, null=True)), - ('pmra', models.FloatField(default=0.0, null=True)), - ('pmra_error', models.FloatField(default=0.0, null=True)), - ('pmdec', models.FloatField(default=0.0, null=True)), - ('pmdec_error', models.FloatField(default=0.0, null=True)), - ('phot_g_mean_mag', models.FloatField(default=0.0, null=True)), - ('phot_bp_mean_mag', models.FloatField(default=0.0, null=True)), - ('phot_rp_mean_mag', models.FloatField(default=0.0, null=True)), - ('catalog_file', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sources', to='sample_app.catalogfile')), - ], - ), - ]