vscode ready

This commit is contained in:
2024-09-28 14:40:40 +02:00
parent 4856f5823f
commit a7f4b797e8
3 changed files with 11 additions and 9 deletions

View File

@@ -101,9 +101,9 @@
" response = farm_client.resource.get('log', type)\n",
" ret = []\n",
" for log in response['data']:\n",
" assets = log['relationships']['asset']['data']\n",
" for asset in assets:\n",
" if asset['id'] == id:\n",
" log_assets = log['relationships']['asset']['data']\n",
" for log_asset in log_assets:\n",
" if log_asset['id'] == asset['id']:\n",
" ret.append(log)\n",
" return ret\n",
"\n",
@@ -129,7 +129,7 @@
" for asset in assets:\n",
" if asset['type'] == 'asset--plant': \n",
" plant_id = asset['id']\n",
" seedings = get_related_logs_of_type(plant_id, 'seeding')\n",
" seedings = get_related_logs_of_type(asset, 'seeding')\n",
" for seeding in seedings:\n",
" area_quants = get_related_quantities_of_measure(seeding, 'area')\n",
" for area_quant in area_quants:\n",
@@ -158,7 +158,7 @@
"print(df)\n",
"\n",
"# Speichere die Tabelle in einer CSV-Datei\n",
"csv_file_path = 'harvest_logs.csv'\n",
"csv_file_path = 'resources/harvest_logs.csv'\n",
"df.to_csv(csv_file_path, index=False)\n",
"\n",
"print(f\"Die Tabelle wurde erfolgreich in der Datei '{csv_file_path}' gespeichert.\")"