Remove 'annual_change' table
This commit is contained in:
parent
6a4af60d53
commit
b7e7c3400d
11
Design.org
11
Design.org
|
@ -45,20 +45,21 @@ CLOSED: [2019-11-01 Fri 00:34]
|
||||||
- [X] Black box
|
- [X] Black box
|
||||||
- [X] Entity-Relationship
|
- [X] Entity-Relationship
|
||||||
** Implementation
|
** Implementation
|
||||||
*** TODO Backend [1/3] [33%]
|
*** TODO Backend [2/3] [66%]
|
||||||
**** DONE Database [3/3] [100%]
|
**** DONE Database [3/3] [100%]
|
||||||
CLOSED: [2020-01-03 Fri 00:44]
|
CLOSED: [2020-01-03 Fri 00:44]
|
||||||
- [X] Connection
|
- [X] Connection
|
||||||
- [X] Creation from script
|
- [X] Creation from script
|
||||||
- [X] Creation of tables via class
|
- [X] Creation of tables via class
|
||||||
**** TODO Parser [3/4] [75%]
|
**** DONE Parser [3/3] [100%]
|
||||||
|
CLOSED: [2020-01-08 Wed 03:18]
|
||||||
- [X] Select useful fiels
|
- [X] Select useful fiels
|
||||||
- [X] Convert PU to Country (ISO 3166)
|
- [X] Convert PU to Country (ISO 3166)
|
||||||
- [X] Insert into database
|
- [X] Insert into database
|
||||||
- [ ] Arithmetic operations for yearly changes
|
**** TODO Flask Application [0/2] [0%]
|
||||||
**** NEXT Flask framework [0/2] [0%]
|
|
||||||
- [ ] Plots with pandas
|
|
||||||
- [ ] Login for admin
|
- [ ] Login for admin
|
||||||
|
- [ ] Arithmetic operations for yearly changes
|
||||||
|
- [ ] Plots with pandas
|
||||||
*** NEXT Documentation
|
*** NEXT Documentation
|
||||||
*** INACTIVE Frontend [0/1] [0%]
|
*** INACTIVE Frontend [0/1] [0%]
|
||||||
- [ ] [[https://adminlte.io/][Adminlte]]
|
- [ ] [[https://adminlte.io/][Adminlte]]
|
||||||
|
|
|
@ -33,7 +33,6 @@ class Glacier(db.Model):
|
||||||
country = db.Column(db.String(60))
|
country = db.Column(db.String(60))
|
||||||
name = db.Column(db.String(60))
|
name = db.Column(db.String(60))
|
||||||
annual_data = db.relationship("Annual_Data")
|
annual_data = db.relationship("Annual_Data")
|
||||||
annual_change = db.relationship("Annual_Change")
|
|
||||||
|
|
||||||
def __init__(self, uid, country, name):
|
def __init__(self, uid, country, name):
|
||||||
self.uid = uid
|
self.uid = uid
|
||||||
|
@ -56,20 +55,6 @@ class Annual_Data(db.Model):
|
||||||
self.elevation = elevation
|
self.elevation = elevation
|
||||||
|
|
||||||
|
|
||||||
class Annual_Change(db.Model):
|
|
||||||
__tablename__ = "annual_change"
|
|
||||||
year = db.Column(db.Integer, db.ForeignKey("annual_data.year"), primary_key=True)
|
|
||||||
uid = db.Column(db.ForeignKey("glacier.uid"), primary_key=True)
|
|
||||||
surface_change = db.Column(db.Float)
|
|
||||||
length_change = db.Column(db.Float)
|
|
||||||
elevation_change = db.Column(db.Float)
|
|
||||||
|
|
||||||
def __init__(self, surface_change, length_change, elevation_change):
|
|
||||||
self.surface_change = surface_change
|
|
||||||
self.length_change = length_change
|
|
||||||
self.elevation_change = elevation_change
|
|
||||||
|
|
||||||
|
|
||||||
class User(db.Model):
|
class User(db.Model):
|
||||||
uid = db.Column(db.Integer, primary_key=True)
|
uid = db.Column(db.Integer, primary_key=True)
|
||||||
registration_date = db.Column(
|
registration_date = db.Column(
|
||||||
|
|
|
@ -16,7 +16,6 @@ def create_dataframes() -> DataFrame:
|
||||||
files = {
|
files = {
|
||||||
"glacier": "../data/glacier.csv",
|
"glacier": "../data/glacier.csv",
|
||||||
"annual_data": "../data/annual_data.csv",
|
"annual_data": "../data/annual_data.csv",
|
||||||
"annual_change": "../data/annual_change.csv",
|
|
||||||
"user": "../data/user.csv",
|
"user": "../data/user.csv",
|
||||||
}
|
}
|
||||||
df_list = {}
|
df_list = {}
|
||||||
|
|
|
@ -55,13 +55,11 @@ def create_databases(df):
|
||||||
files = {
|
files = {
|
||||||
"glacier": "../data/glacier.csv",
|
"glacier": "../data/glacier.csv",
|
||||||
"annual_data": "../data/annual_data.csv",
|
"annual_data": "../data/annual_data.csv",
|
||||||
"annual_change": "../data/annual_change.csv",
|
|
||||||
"user": "../data/user.csv",
|
"user": "../data/user.csv",
|
||||||
}
|
}
|
||||||
dataframes = {
|
dataframes = {
|
||||||
"glacier": df[["POLITICAL_UNIT", "NAME", "WGMS_ID"]].drop_duplicates(),
|
"glacier": df[["POLITICAL_UNIT", "NAME", "WGMS_ID"]].drop_duplicates(),
|
||||||
"annual_data": df[["WGMS_ID", "YEAR", "AREA", "MEDIAN_ELEVATION", "LENGTH"]],
|
"annual_data": df[["WGMS_ID", "YEAR", "AREA", "MEDIAN_ELEVATION", "LENGTH"]],
|
||||||
"annual_change": df[["WGMS_ID", "YEAR"]],
|
|
||||||
"user": DataFrame(user),
|
"user": DataFrame(user),
|
||||||
}
|
}
|
||||||
renamed_dfs = rename_fields(dataframes)
|
renamed_dfs = rename_fields(dataframes)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue