From b912eddba6e30328f35f355db74654f3f7c4ba47 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 27 Jan 2024 16:44:37 -0500 Subject: [PATCH 01/16] Panel data script Python script to upload panel data to PostgreSQL database --- scripts/panels_data/panels_data.py | 55 ++++++++++++++++++++++++++++ scripts/panels_data/requirements.txt | 2 + 2 files changed, 57 insertions(+) create mode 100644 scripts/panels_data/panels_data.py create mode 100644 scripts/panels_data/requirements.txt diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py new file mode 100644 index 0000000..5142eb3 --- /dev/null +++ b/scripts/panels_data/panels_data.py @@ -0,0 +1,55 @@ +import psycopg2 +import os +from dotenv import load_dotenv + +load_dotenv() + +hostname = os.getenv("DB_HOSTNAME") +database = os.getenv("DB_NAME") +username = os.getenv("DB_USERNAME") +pw = os.getenv("DB_PASSWORD") +port_id = os.getenv("DB_PORT") + +conn = psycopg2.connect( + host = hostname, + dbname = database, + user = username, + password = pw, + port = port_id +) + +cur = conn.cursor() +cur.execute("DROP TABLE IF EXISTS panels_data") + +create_table = '''CREATE TABLE IF NOT EXISTS panels_data ( + id serial4 NOT NULL, + name text NOT NULL, + stack int4 NOT NULL, + efficiency float4, + num_panels int4 NOT NULL, + tilt float4 NOT NULL + )''' +cur.execute(create_table) + +insert_table = "INSERT INTO panels_data(name, stack, efficiency, num_panels, tilt) VALUES (%s, %s, %s, %s, %s)" +insert_values = [("Back Left 1", 7, 0.25, 28, -8.28), + ("Back Right 1", 8, 0.25, 28, -8.28), + ("Back Middle 1", 3, 0.25, 12, -8.06), + ("Back Left 2", 9, 0.25, 28, -5.21), + ("Back Right 2", 10, 0.25, 28, -5.21), + ("Middle Left 1", 15, 0.25, 18, -2.14), + ("Middle Right 1", 16, 0.25, 18, -2.14), + ("Middle Left 2", 4, 0.25, 10, 0.77), + ("Middle Right 2", 4, 0.25, 10, 0.77), + ("Front Left", 13, 0.25, 21, 5.13), + ("Front Right", 2, 0.25, 21, 5.13), + ("Front Middle", 11, 0.25, 16, 8.75), + ] + +for values in insert_values: + cur.execute(insert_table, values) + +cur.close() +conn.commit() +conn.close() + diff --git a/scripts/panels_data/requirements.txt b/scripts/panels_data/requirements.txt new file mode 100644 index 0000000..eae8335 --- /dev/null +++ b/scripts/panels_data/requirements.txt @@ -0,0 +1,2 @@ +psycopg2-binary +python-dotenv \ No newline at end of file From 4c6edcf1acfefe751de9d56ed5e85b1dd5651976 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:10:06 -0500 Subject: [PATCH 02/16] Panel data script update Added README and a couple comments --- scripts/panels_data/README.txt | 18 ++++++++++++++++++ scripts/panels_data/panels_data.py | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 scripts/panels_data/README.txt diff --git a/scripts/panels_data/README.txt b/scripts/panels_data/README.txt new file mode 100644 index 0000000..0ba69f5 --- /dev/null +++ b/scripts/panels_data/README.txt @@ -0,0 +1,18 @@ +Python script to upload solar panel data to PostgreSQL database +--------------------------------------------------------------- +Based on this information: https://uwmidsun.atlassian.net/wiki/x/HgAnsQ + +Fields: +id - autoincrementing integer value, do not input manually +name - name of solar panel, naming scheme goes from back --> front, imagine that you are standing in front of the car and looking at it +*if another naming scheme is preferred, feel free to change it +stack - which stack the panel belongs to +efficiency - how efficient the panels are +*currently set to 0.25, change if necessary +num_panels - how many panels it is made up of +title - degree from zenith + +Fields and values can be changed, added, or deleted by editing the script + +CREATE TABLE documentation: https://www.postgresql.org/docs/current/sql-createtable.html +INSERT documentation: https://www.postgresql.org/docs/current/sql-insert.html diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py index 5142eb3..ceb105d 100644 --- a/scripts/panels_data/panels_data.py +++ b/scripts/panels_data/panels_data.py @@ -2,6 +2,7 @@ import os from dotenv import load_dotenv +# loads variables from .env file that contains the information required to access the database load_dotenv() hostname = os.getenv("DB_HOSTNAME") @@ -10,6 +11,7 @@ pw = os.getenv("DB_PASSWORD") port_id = os.getenv("DB_PORT") +# connect using psycopg2 with host name, database name, username, password, and port conn = psycopg2.connect( host = hostname, dbname = database, @@ -18,6 +20,7 @@ port = port_id ) +# deletes table if it exists to create a new one cur = conn.cursor() cur.execute("DROP TABLE IF EXISTS panels_data") @@ -31,6 +34,7 @@ )''' cur.execute(create_table) +# inserts multiple records insert_table = "INSERT INTO panels_data(name, stack, efficiency, num_panels, tilt) VALUES (%s, %s, %s, %s, %s)" insert_values = [("Back Left 1", 7, 0.25, 28, -8.28), ("Back Right 1", 8, 0.25, 28, -8.28), @@ -49,6 +53,7 @@ for values in insert_values: cur.execute(insert_table, values) +# close connection cur.close() conn.commit() conn.close() From fa3e4b6915b5c9d1d997946278828ae9ae5782c4 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:10:31 -0500 Subject: [PATCH 03/16] Update README.txt --- scripts/panels_data/README.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/panels_data/README.txt b/scripts/panels_data/README.txt index 0ba69f5..c864d63 100644 --- a/scripts/panels_data/README.txt +++ b/scripts/panels_data/README.txt @@ -5,10 +5,10 @@ Based on this information: https://uwmidsun.atlassian.net/wiki/x/HgAnsQ Fields: id - autoincrementing integer value, do not input manually name - name of solar panel, naming scheme goes from back --> front, imagine that you are standing in front of the car and looking at it -*if another naming scheme is preferred, feel free to change it + *if another naming scheme is preferred, feel free to change it stack - which stack the panel belongs to efficiency - how efficient the panels are -*currently set to 0.25, change if necessary + *currently set to 0.25, change if necessary num_panels - how many panels it is made up of title - degree from zenith From c699f8baf541d13085bb64feac719e9cadc7748b Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:13:28 -0500 Subject: [PATCH 04/16] Update README.txt --- scripts/panels_data/README.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/panels_data/README.txt b/scripts/panels_data/README.txt index c864d63..fcafd79 100644 --- a/scripts/panels_data/README.txt +++ b/scripts/panels_data/README.txt @@ -16,3 +16,9 @@ Fields and values can be changed, added, or deleted by editing the script CREATE TABLE documentation: https://www.postgresql.org/docs/current/sql-createtable.html INSERT documentation: https://www.postgresql.org/docs/current/sql-insert.html +---------------------------------------------------------------- +To do: +Add solar panel dimensions (width and height) + + + From dfab99a3520abc0c3ca5b985d3bf0427545e9b19 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:51:03 -0500 Subject: [PATCH 05/16] Update README.txt --- scripts/panels_data/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/panels_data/README.txt b/scripts/panels_data/README.txt index fcafd79..69462db 100644 --- a/scripts/panels_data/README.txt +++ b/scripts/panels_data/README.txt @@ -10,7 +10,7 @@ stack - which stack the panel belongs to efficiency - how efficient the panels are *currently set to 0.25, change if necessary num_panels - how many panels it is made up of -title - degree from zenith +tilt - degree from zenith Fields and values can be changed, added, or deleted by editing the script From f9dcbb932622e3e2c64f2364ae08d0eb33fa0a5a Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:44:28 -0500 Subject: [PATCH 06/16] Updated panels_data.py based on feedback - Changed to work as a function and abstracted the queries to allow Solar Panel to work as a class --- panels_data.py | 143 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 panels_data.py diff --git a/panels_data.py b/panels_data.py new file mode 100644 index 0000000..b3ffe11 --- /dev/null +++ b/panels_data.py @@ -0,0 +1,143 @@ +from sqlalchemy import create_engine, Column, Integer, String, Float +from sqlalchemy.orm import declarative_base, sessionmaker +from sqlalchemy.engine import URL + +Base = declarative_base() + + +# creating Panel class to declare the structure of the database table and define what the entries look like +class Panel(Base): + __tablename__ = "panels_data" + + id = Column(Integer(), primary_key=True, autoincrement=True) + name = Column(String(100), nullable=False, unique=True) + stack = Column(Integer(), nullable=False) + efficiency = Column(Float(), nullable=False) + num_panels = Column(Integer(), nullable=False) + tilt = Column(Float(), nullable=False) + + +def create_panel_table(db_user, db_password, db_host, db_name): + # connecting to database + engine = create_engine( + f"postgresql+psycopg2://{db_user}:{db_password}@{db_host}/{db_name}" + ) + + # creates corresponding tables + Base.metadata.create_all(engine) + + # create session + Session = sessionmaker(bind=engine) + session = Session() + + # setting entry values + panel_data = [ + { + "name": "Back Left 1", + "stack": 7, + "efficiency": 0.25, + "num_panels": 28, + "tilt": -8.28, + }, + { + "name": "Back Right 1", + "stack": 8, + "efficiency": 0.25, + "num_panels": 28, + "tilt": -8.28, + }, + { + "name": "Back Middle 1", + "stack": 3, + "efficiency": 0.25, + "num_panels": 12, + "tilt": -8.06, + }, + { + "name": "Back Left 2", + "stack": 9, + "efficiency": 0.25, + "num_panels": 28, + "tilt": -5.21, + }, + { + "name": "Back Right 2", + "stack": 10, + "efficiency": 0.25, + "num_panels": 28, + "tilt": -5.21, + }, + { + "name": "Middle Left 1", + "stack": 15, + "efficiency": 0.25, + "num_panels": 18, + "tilt": -2.14, + }, + { + "name": "Middle Right 1", + "stack": 16, + "efficiency": 0.25, + "num_panels": 18, + "tilt": -2.14, + }, + { + "name": "Middle Left 2", + "stack": 4, + "efficiency": 0.25, + "num_panels": 10, + "tilt": 0.77, + }, + { + "name": "Middle Right 2", + "stack": 4, + "efficiency": 0.25, + "num_panels": 10, + "tilt": 0.77, + }, + { + "name": "Front Left", + "stack": 13, + "efficiency": 0.25, + "num_panels": 21, + "tilt": 5.13, + }, + { + "name": "Front Right", + "stack": 2, + "efficiency": 0.25, + "num_panels": 21, + "tilt": 5.13, + }, + { + "name": "Front Middle", + "stack": 11, + "efficiency": 0.25, + "num_panels": 16, + "tilt": 8.75, + }, + ] + # unpacking each entry to create a Panel instance and adding to table + for data in panel_data: + panel = Panel(**data) + session.add(panel) + + # upload to database + session.commit() + print("Table added successfully.") + # disconnect + engine.dispose() + + +def main(db_user, db_password, db_host, db_name): + print("Uploading solar panel data into panel_data...") + create_panel_table(db_user, db_password, db_host, db_name) + + +# allows it to be run as a script +if __name__ == "__main__": + db_user = "" + db_password = "" + db_host = "" + db_name = "" + main(db_user, db_password, db_host, db_name) From d215dc6b50a3825bdcd96aa28d6e8851e4e1927a Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:35:02 -0500 Subject: [PATCH 07/16] Rename panels_data.py to scripts/panel_data/panels_data.py --- panels_data.py => scripts/panel_data/panels_data.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename panels_data.py => scripts/panel_data/panels_data.py (100%) diff --git a/panels_data.py b/scripts/panel_data/panels_data.py similarity index 100% rename from panels_data.py rename to scripts/panel_data/panels_data.py From 08ad108b1e4f9dea50dadbdbbdbc56fdb2700e51 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:38:04 -0500 Subject: [PATCH 08/16] Delete scripts/panels_data/panels_data.py --- scripts/panels_data/panels_data.py | 60 ------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 scripts/panels_data/panels_data.py diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py deleted file mode 100644 index ceb105d..0000000 --- a/scripts/panels_data/panels_data.py +++ /dev/null @@ -1,60 +0,0 @@ -import psycopg2 -import os -from dotenv import load_dotenv - -# loads variables from .env file that contains the information required to access the database -load_dotenv() - -hostname = os.getenv("DB_HOSTNAME") -database = os.getenv("DB_NAME") -username = os.getenv("DB_USERNAME") -pw = os.getenv("DB_PASSWORD") -port_id = os.getenv("DB_PORT") - -# connect using psycopg2 with host name, database name, username, password, and port -conn = psycopg2.connect( - host = hostname, - dbname = database, - user = username, - password = pw, - port = port_id -) - -# deletes table if it exists to create a new one -cur = conn.cursor() -cur.execute("DROP TABLE IF EXISTS panels_data") - -create_table = '''CREATE TABLE IF NOT EXISTS panels_data ( - id serial4 NOT NULL, - name text NOT NULL, - stack int4 NOT NULL, - efficiency float4, - num_panels int4 NOT NULL, - tilt float4 NOT NULL - )''' -cur.execute(create_table) - -# inserts multiple records -insert_table = "INSERT INTO panels_data(name, stack, efficiency, num_panels, tilt) VALUES (%s, %s, %s, %s, %s)" -insert_values = [("Back Left 1", 7, 0.25, 28, -8.28), - ("Back Right 1", 8, 0.25, 28, -8.28), - ("Back Middle 1", 3, 0.25, 12, -8.06), - ("Back Left 2", 9, 0.25, 28, -5.21), - ("Back Right 2", 10, 0.25, 28, -5.21), - ("Middle Left 1", 15, 0.25, 18, -2.14), - ("Middle Right 1", 16, 0.25, 18, -2.14), - ("Middle Left 2", 4, 0.25, 10, 0.77), - ("Middle Right 2", 4, 0.25, 10, 0.77), - ("Front Left", 13, 0.25, 21, 5.13), - ("Front Right", 2, 0.25, 21, 5.13), - ("Front Middle", 11, 0.25, 16, 8.75), - ] - -for values in insert_values: - cur.execute(insert_table, values) - -# close connection -cur.close() -conn.commit() -conn.close() - From f594bbd738366060581a230126067a899d8b274c Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:38:25 -0500 Subject: [PATCH 09/16] Rename panels_data.py to panels_data.py --- scripts/{panel_data => panels_data}/panels_data.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{panel_data => panels_data}/panels_data.py (100%) diff --git a/scripts/panel_data/panels_data.py b/scripts/panels_data/panels_data.py similarity index 100% rename from scripts/panel_data/panels_data.py rename to scripts/panels_data/panels_data.py From 9f65cc9ee9a7cda6dd498280aafe623f09f73241 Mon Sep 17 00:00:00 2001 From: Jina Yang Date: Sat, 3 Feb 2024 11:52:33 -0500 Subject: [PATCH 10/16] Changes to panels_data.py --- .DS_Store | Bin 0 -> 6148 bytes scripts/.DS_Store | Bin 0 -> 6148 bytes scripts/panels_data/panels_data.py | 37 ++++++++++++++++++++------- scripts/panels_data/requirements.txt | 3 ++- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 .DS_Store create mode 100644 scripts/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a01e89ac6219f9e3a57a4d3183588d0b43914910 GIT binary patch literal 6148 zcmeHK%}T>S5T0$TO({YT3OxqA7EBcs@e*Qv0V8@)sYz2b7_%iw&7l->))(?gd>&_Z zx1v^0f=HQx*>5^Oo9>sg(*XeCO`|?Q2LLQo!deTLZ-nBcOHwnQI-*c}OrU@~Eb~d2 zEM>FfKQch?t_eAeAcGh_ygwOYE5fszh3$jc4 zbS7mIF6|elhZWHRjscBR?BJ)JKfoAukZBi z{(gVnvuB69XdgJveBQFQws($Bhxf@tDxWl!0)KT%HViJ{8I3QeitntYp~LY5fq_I5p}6BBZkoB=(kOtYp~L&%R!joLzpKEGoc9ebll%o=^$K< zyfOpKz-I<%_Cx7V|3CS8{#Qx7FaylMYBC@i1ApM**-UR;Iwkd58}$a2gz_ql?=jj+JAO)^R0slTUx??Y#664dsAzA?9is3NM zqn98y4-k9dl*kCpl1fafRf}OsXS`KjFPsvS4y)$F>Sn7B#o~6J-y$8>6E#W!DKJ;y zHkVtk{}1#(`u{meD=8oau1W!0?H~6$KB;Q!;&EPU8~vH?Ip1_Q&V#}s$}us@F&AEr e?; Date: Sun, 18 Feb 2024 21:54:47 -0500 Subject: [PATCH 11/16] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index a01e89ac6219f9e3a57a4d3183588d0b43914910..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T0$TO({YT3OxqA7EBcs@e*Qv0V8@)sYz2b7_%iw&7l->))(?gd>&_Z zx1v^0f=HQx*>5^Oo9>sg(*XeCO`|?Q2LLQo!deTLZ-nBcOHwnQI-*c}OrU@~Eb~d2 zEM>FfKQch?t_eAeAcGh_ygwOYE5fszh3$jc4 zbS7mIF6|elhZWHRjscBR?BJ)JKfoAukZBi z{(gVnvuB69XdgJveBQFQws($Bhxf@tDxWl!0)KT%HViJ{8I3QeitntYp~LY5fq_I5p}6BBZkoB=(kOtYp~L&%R!joLzpKEGoc9ebll%o=^$K< zyfOpKz-I<%_Cx7V|3CS8{#Qx7FaylMYBC@i1ApM**-UR;Iwkd58}$a2gz_ql? Date: Mon, 19 Feb 2024 14:39:18 -0500 Subject: [PATCH 12/16] Adding width, height, and area and descriptions in the README --- scripts/panels_data/README.txt | 12 +++---- scripts/panels_data/panels_data.py | 53 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 6 deletions(-) diff --git a/scripts/panels_data/README.txt b/scripts/panels_data/README.txt index 69462db..af535a3 100644 --- a/scripts/panels_data/README.txt +++ b/scripts/panels_data/README.txt @@ -11,14 +11,14 @@ efficiency - how efficient the panels are *currently set to 0.25, change if necessary num_panels - how many panels it is made up of tilt - degree from zenith +width - width of panel in meters (based off each cell being 0.125m wide) +height - height of panel in meters (based off each cell being 0.125m wide) +area - area of panel in meters^2 (based off each cell having an area of roughly 0.0153m^2 -> from the data sheet) +(note: the individual cells are not perfect squares and there are bond pads that do not absorb sunlight so there is a discrepancy +between the area from multiplying width and height and the approximate area based off the data sheet.) Fields and values can be changed, added, or deleted by editing the script - -CREATE TABLE documentation: https://www.postgresql.org/docs/current/sql-createtable.html -INSERT documentation: https://www.postgresql.org/docs/current/sql-insert.html ----------------------------------------------------------------- -To do: -Add solar panel dimensions (width and height) +----------------------------------------------------------------- diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py index 131f959..25d3b68 100644 --- a/scripts/panels_data/panels_data.py +++ b/scripts/panels_data/panels_data.py @@ -18,6 +18,9 @@ class Panel(Base): efficiency = Column(Float(), nullable=False) num_panels = Column(Integer(), nullable=False) tilt = Column(Float(), nullable=False) + width = Column(Float(), nullable=False) + height = Column(Float(), nullable=False) + area = Column(Float(), nullable=False) def create_panel_table(db_user, db_password, db_host, db_name): @@ -41,7 +44,11 @@ def create_panel_table(db_user, db_password, db_host, db_name): Column("efficiency", Float(), nullable=False), Column("num_panels", Integer(), nullable=False), Column("tilt", Float(), nullable=False), + Column("width", Float(), nullable=False), + Column("height", Float(), nullable=False), + Column("area", Float(), nullable=False) ) + panel_area = 0.0153 # drop if exists panel_table.drop(engine, checkfirst=True) @@ -57,6 +64,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 28, "tilt": -8.28, + "width": 0.5, + "height": 0.875, + "area": 28*panel_area }, { "name": "Back Right 1", @@ -64,6 +74,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 28, "tilt": -8.28, + "width": 0.5, + "height": 0.875, + "area": 28*panel_area }, { "name": "Back Middle 1", @@ -71,6 +84,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 12, "tilt": -8.06, + "width": 0.25, + "height": 0.75, + "area": 12*panel_area }, { "name": "Back Left 2", @@ -78,6 +94,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 28, "tilt": -5.21, + "width": 0.5, + "height": 0.875, + "area": 28*panel_area }, { "name": "Back Right 2", @@ -85,6 +104,19 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 28, "tilt": -5.21, + "width": 0.5, + "height": 0.875, + "area": 28*panel_area + }, + { + "name": "Back Middle 2", + "stack": 1, + "efficiency": 0.25, + "num_panels": 21, + "tilt": -5.21, + "width": 0.375, + "height": 0.875, + "area": 21*panel_area }, { "name": "Middle Left 1", @@ -92,6 +124,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 18, "tilt": -2.14, + "width": 0.375, + "height": 0.75, + "area": 18*panel_area }, { "name": "Middle Right 1", @@ -99,6 +134,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 18, "tilt": -2.14, + "width": 0.375, + "height": 0.75, + "area": 18*panel_area }, { "name": "Middle Left 2", @@ -106,6 +144,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 10, "tilt": 0.77, + "width": 0.25, + "height": 0.625, + "area": 10*panel_area }, { "name": "Middle Right 2", @@ -113,6 +154,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 10, "tilt": 0.77, + "width": 0.25, + "height": 0.625, + "area": 10*panel_area }, { "name": "Front Left", @@ -120,6 +164,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 21, "tilt": 5.13, + "width": 0.375, + "height": 0.875, + "area": 21*panel_area }, { "name": "Front Right", @@ -127,6 +174,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 21, "tilt": 5.13, + "width": 0.375, + "height": 0.875, + "area": 21*panel_area }, { "name": "Front Middle", @@ -134,6 +184,9 @@ def create_panel_table(db_user, db_password, db_host, db_name): "efficiency": 0.25, "num_panels": 16, "tilt": 8.75, + "width": 0.5, + "height": 0.5, + "area": 16*panel_area }, ] # unpacking each entry to create a Panel instance and adding to table From 59f290b5b7c4f9ad59d89f807c0112dad6c632a0 Mon Sep 17 00:00:00 2001 From: jinayang15 <82282956+jinayang15@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:39:56 -0500 Subject: [PATCH 13/16] Delete scripts/.DS_Store --- scripts/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 scripts/.DS_Store diff --git a/scripts/.DS_Store b/scripts/.DS_Store deleted file mode 100644 index 0229616aee0ea645cdf8e4aa9ffb17f6691c1933..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c!5S)b+k=jj+JAO)^R0slTUx??Y#664dsAzA?9is3NM zqn98y4-k9dl*kCpl1fafRf}OsXS`KjFPsvS4y)$F>Sn7B#o~6J-y$8>6E#W!DKJ;y zHkVtk{}1#(`u{meD=8oau1W!0?H~6$KB;Q!;&EPU8~vH?Ip1_Q&V#}s$}us@F&AEr e?; Date: Mon, 19 Feb 2024 16:11:56 -0500 Subject: [PATCH 14/16] Linting... --- scripts/panels_data/panels_data.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py index 25d3b68..146067b 100644 --- a/scripts/panels_data/panels_data.py +++ b/scripts/panels_data/panels_data.py @@ -46,7 +46,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): Column("tilt", Float(), nullable=False), Column("width", Float(), nullable=False), Column("height", Float(), nullable=False), - Column("area", Float(), nullable=False) + Column("area", Float(), nullable=False), ) panel_area = 0.0153 @@ -66,7 +66,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -8.28, "width": 0.5, "height": 0.875, - "area": 28*panel_area + "area": 28 * panel_area, }, { "name": "Back Right 1", @@ -76,7 +76,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -8.28, "width": 0.5, "height": 0.875, - "area": 28*panel_area + "area": 28 * panel_area, }, { "name": "Back Middle 1", @@ -86,7 +86,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -8.06, "width": 0.25, "height": 0.75, - "area": 12*panel_area + "area": 12 * panel_area, }, { "name": "Back Left 2", @@ -96,7 +96,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -5.21, "width": 0.5, "height": 0.875, - "area": 28*panel_area + "area": 28 * panel_area, }, { "name": "Back Right 2", @@ -106,7 +106,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -5.21, "width": 0.5, "height": 0.875, - "area": 28*panel_area + "area": 28 * panel_area, }, { "name": "Back Middle 2", @@ -116,7 +116,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -5.21, "width": 0.375, "height": 0.875, - "area": 21*panel_area + "area": 21 * panel_area, }, { "name": "Middle Left 1", @@ -126,7 +126,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -2.14, "width": 0.375, "height": 0.75, - "area": 18*panel_area + "area": 18 * panel_area, }, { "name": "Middle Right 1", @@ -136,7 +136,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -2.14, "width": 0.375, "height": 0.75, - "area": 18*panel_area + "area": 18 * panel_area, }, { "name": "Middle Left 2", @@ -146,7 +146,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 0.77, "width": 0.25, "height": 0.625, - "area": 10*panel_area + "area": 10 * panel_area, }, { "name": "Middle Right 2", @@ -156,7 +156,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 0.77, "width": 0.25, "height": 0.625, - "area": 10*panel_area + "area": 10 * panel_area, }, { "name": "Front Left", @@ -166,7 +166,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 5.13, "width": 0.375, "height": 0.875, - "area": 21*panel_area + "area": 21 * panel_area, }, { "name": "Front Right", @@ -176,7 +176,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 5.13, "width": 0.375, "height": 0.875, - "area": 21*panel_area + "area": 21 * panel_area, }, { "name": "Front Middle", @@ -186,7 +186,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 8.75, "width": 0.5, "height": 0.5, - "area": 16*panel_area + "area": 16 * panel_area, }, ] # unpacking each entry to create a Panel instance and adding to table From f8e2658340ee4236dc45374c243b91f33b4a4dce Mon Sep 17 00:00:00 2001 From: jinayang15 Date: Sun, 10 Mar 2024 20:08:42 -0400 Subject: [PATCH 15/16] Update panels_data.py Updating script to match changes made to the solar panel layout --- scripts/panels_data/panels_data.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py index 146067b..6b1c45a 100644 --- a/scripts/panels_data/panels_data.py +++ b/scripts/panels_data/panels_data.py @@ -48,7 +48,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): Column("height", Float(), nullable=False), Column("area", Float(), nullable=False), ) - panel_area = 0.0153 + panel_area = 0.015333 # drop if exists panel_table.drop(engine, checkfirst=True) @@ -80,12 +80,12 @@ def create_panel_table(db_user, db_password, db_host, db_name): }, { "name": "Back Middle 1", - "stack": 3, + "stack": 6, "efficiency": 0.25, - "num_panels": 12, + "num_panels": 8, "tilt": -8.06, "width": 0.25, - "height": 0.75, + "height": 0.5, "area": 12 * panel_area, }, { @@ -179,7 +179,17 @@ def create_panel_table(db_user, db_password, db_host, db_name): "area": 21 * panel_area, }, { - "name": "Front Middle", + "name": "Front Middle 1", + "stack": 6, + "efficiency": 0.25, + "num_panels": 5, + "tilt": 8.75, + "width": 0.125, + "height": 0.75, + "area": 16 * panel_area, + }, + { + "name": "Front Middle 2", "stack": 11, "efficiency": 0.25, "num_panels": 16, From 0ccbc7e3da50bee332edabb8827343515b45d44c Mon Sep 17 00:00:00 2001 From: jinayang15 Date: Sun, 10 Mar 2024 20:20:16 -0400 Subject: [PATCH 16/16] Updated panel area --- scripts/panels_data/panels_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/panels_data/panels_data.py b/scripts/panels_data/panels_data.py index 6b1c45a..dfce2ce 100644 --- a/scripts/panels_data/panels_data.py +++ b/scripts/panels_data/panels_data.py @@ -86,7 +86,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": -8.06, "width": 0.25, "height": 0.5, - "area": 12 * panel_area, + "area": 8 * panel_area, }, { "name": "Back Left 2", @@ -186,7 +186,7 @@ def create_panel_table(db_user, db_password, db_host, db_name): "tilt": 8.75, "width": 0.125, "height": 0.75, - "area": 16 * panel_area, + "area": 5 * panel_area, }, { "name": "Front Middle 2",