solresol / solar-panel-astronomy

Doing lunar astronomy using domestic solar panels
The Unlicense
0 stars 0 forks source link

Sweep: exporter.py is using the wrong database table name #20

Open solresol opened 2 months ago

solresol commented 2 months ago

Details

Instead of weather, it should be using weather_data

Checklist - [X] Modify `exporter.py` βœ“ https://github.com/solresol/solar-panel-astronomy/commit/edc3a6950ae79e877c63343cef6fd13df87b0240 [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/exporterpy_is_using_the_wrong_database_t/exporter.py#L55-L78) - [X] Running GitHub Actions for `exporter.py` βœ“ [Edit](https://github.com/solresol/solar-panel-astronomy/edit/sweep/exporterpy_is_using_the_wrong_database_t/exporter.py#L55-L78)
ifost-autodev[bot] commented 2 months ago

πŸš€ Here's the PR! #21

See Sweep's progress at the progress dashboard!
πŸ’Ž Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: None)

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)

GitHub Actionsβœ“

Here are the GitHub Actions logs prior to making any changes:

Sandbox logs for 6f20658
Checking exporter.py for syntax errors... βœ… exporter.py has no syntax errors! 1/1 βœ“
Checking exporter.py for syntax errors...
βœ… exporter.py has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: πŸ”Ž Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/solresol/solar-panel-astronomy/blob/6f2065850103e114180c3937b1d680d9e5e21d9d/exporter.py#L51-L85

Step 2: ⌨️ Coding

--- 
+++ 
@@ -52,7 +52,7 @@
 def write_sqlite(conn, weather_data, astronomy_data):
     cursor = conn.cursor()
     cursor.execute("""
-    CREATE TABLE IF NOT EXISTS weather (
+    CREATE TABLE IF NOT EXISTS weather_data (
         when_recorded TIMESTAMP,
         clouds FLOAT
     )
@@ -75,7 +75,7 @@
     cursor.execute("DELETE FROM astronomy")
     conn.commit()
     for i, record in enumerate(weather_data):
-        cursor.execute("INSERT INTO weather (when_recorded, clouds) VALUES (?, ?)", record)
+        cursor.execute("INSERT INTO weather_data (when_recorded, clouds) VALUES (?, ?)", record)
         if i % 1000 == 0:
             conn.commit()
     for i, record in enumerate(astronomy_data):

Ran GitHub Actions for edc3a6950ae79e877c63343cef6fd13df87b0240:
β€’ build: βœ“


Step 3: πŸ” Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/exporterpy_is_using_the_wrong_database_t.


πŸŽ‰ Latest improvements to Sweep:


πŸ’‘ To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord