Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/notebooks/Example_About_Service_endpoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
"## 0. Prerequisites\n",
"\n",
"**Notebook Information:**\n",
"- **Last Updated:** February 2026\n",
"- **Written for:** SolarFarmer SDK v0.1.0+\n",
"- **Last Updated:** May 2026\n",
"- **Written for:** SolarFarmer SDK v0.2.0+\n",
"- [View latest version in repository](https://...)\n",
"\n",
"### 0.1 Install the SolarFarmer Python SDK\n",
"\n",
"This notebook requires the SolarFarmer Python SDK to be installed. Install it via pip:\n",
"\n",
"```bash\n",
"pip install solarfarmer\n",
"pip install dnv-solarfarmer\n",
"```"
]
},
Expand All @@ -46,7 +46,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"SolarFarmer Python SDK v0.1.0\n"
"SolarFarmer Python SDK v0.2.0\n"
]
}
],
Expand All @@ -55,7 +55,7 @@
"import solarfarmer as sf\n",
"\n",
"# Check SDK version compatibility\n",
"NOTEBOOK_MIN_SDK_VERSION = \"0.1.0\"\n",
"NOTEBOOK_MIN_SDK_VERSION = \"0.2.0\"\n",
"\n",
"print(f\"SolarFarmer Python SDK v{sf.__version__}\")\n",
"\n",
Expand Down Expand Up @@ -185,14 +185,14 @@
"name": "stderr",
"output_type": "stream",
"text": [
"INFO: SF-Core version: 0.4.423.0\n",
"INFO: SF-API version: 6.0.19\n"
"INFO: SF-Core version: 0.4.429.0\n",
"INFO: SF-API version: 6.0.21\n"
]
},
{
"data": {
"text/plain": [
"{'solarFarmerCoreVersion': '0.4.423.0', 'solarFarmerApiVersion': '6.0.19'}"
"{'solarFarmerCoreVersion': '0.4.429.0', 'solarFarmerApiVersion': '6.0.21'}"
]
},
"metadata": {},
Expand Down Expand Up @@ -363,7 +363,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "solarfarmer",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -377,7 +377,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.13"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
152 changes: 75 additions & 77 deletions docs/notebooks/Example_Compose_Plant.ipynb

Large diffs are not rendered by default.

77 changes: 38 additions & 39 deletions docs/notebooks/Example_EnergyCalculations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
"## 0. Prerequisites\n",
"\n",
"**Notebook Information:**\n",
"- **Last Updated:** February 2026\n",
"- **Written for:** SolarFarmer SDK v0.1.0+\n",
"- **Last Updated:** May 2026\n",
"- **Written for:** SolarFarmer SDK v0.2.0+\n",
"- [View latest version in repository](https://...)\n",
"\n",
"### 0.1 Install the SolarFarmer Python SDK\n",
"\n",
"This notebook requires the SolarFarmer Python SDK to be installed. Install it via pip:\n",
"\n",
"```bash\n",
"pip install solarfarmer\n",
"pip install dnv-solarfarmer\n",
"```"
]
},
Expand All @@ -50,7 +50,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"SolarFarmer Python SDK v0.1.0\n"
"SolarFarmer Python SDK v0.2.0\n"
]
}
],
Expand All @@ -67,7 +67,7 @@
" print(\"Install it with: pip install pandas\\n\")\n",
"\n",
"# Check SDK version compatibility\n",
"NOTEBOOK_MIN_SDK_VERSION = \"0.1.0\"\n",
"NOTEBOOK_MIN_SDK_VERSION = \"0.2.0\"\n",
"\n",
"print(f\"SolarFarmer Python SDK v{sf.__version__}\")\n",
"\n",
Expand Down Expand Up @@ -158,10 +158,10 @@
"\n",
"Clone the full repository:\n",
"```bash\n",
"git clone tbd.git\n",
"git clone https://github.com/dnv-opensource/solarfarmer-python-sdk.git\n",
"```\n",
"\n",
"Or download the `docs/notebooks/sample_data/` folder directly from the [repository](tbd):\n",
"Or download the `docs/notebooks/sample_data/` folder directly from the [repository](https://github.com/dnv-opensource/solarfarmer-python-sdk/):\n",
"\n",
"\n",
"The examples below assume the data is in a `sample_data/` folder relative to this notebook, but you can place it anywhere and update the path in the next cell."
Expand All @@ -177,7 +177,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Sample data found at: /home/iantse/git_repos/solarfarmer-api-python-sdk/docs/notebooks/sample_data\n"
"Sample data found at: c:\\repos\\solarfarmer-python-sdk-github\\docs\\notebooks\\sample_data\n"
]
}
],
Expand All @@ -189,7 +189,7 @@
"# Verify the path exists\n",
"if not sample_data_dir.exists():\n",
" print(f\"WARNING: Sample data not found at: {sample_data_dir.absolute()}\")\n",
" print(\"Please download from: https://...\") #TODO: Add actual URL\n",
" print(\"Please download from `docs/notebooks/sample_data` in https://github.com/dnv-opensource/solarfarmer-python-sdk/\")\n",
" print(\"Or update the 'sample_data_dir' path above.\")\n",
"else:\n",
" print(f\"Sample data found at: {sample_data_dir.absolute()}\")"
Expand Down Expand Up @@ -220,10 +220,8 @@
"output_type": "stream",
"text": [
"INFO: Making API call to ModelChain (2D) endpoint: https://solarfarmer.dnv.com/latest/api/ModelChain\n",
"Start time = 02-03-2026 13:51:20\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 12.7 seconds)\n",
"/home/iantse/git_repos/solarfarmer-api-python-sdk/solarfarmer/models/energy_calculation_results.py:1769: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.\n",
" data[\"date\"] = pd.to_datetime(data[\"date\"], utc=True).dt.tz_localize(None)\n"
"Start time = 05-05-2026 12:13:41\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 6.4 seconds)\n"
]
},
{
Expand All @@ -239,7 +237,7 @@
"Mounting type = Fixed-tilt racks\n",
"AC capacity of system = 0.375 MW\n",
"DC capacity of system = 0.4455 MW\n",
"Run in SolarFarmer API version 6.0.19\n",
"Run in SolarFarmer API version 6.0.21\n",
"-------------------------------------------------------\n",
" Annual Performance Summary (project year 1, 2017)\n",
"------------------------------------- ---------------\n",
Expand Down Expand Up @@ -299,10 +297,8 @@
"output_type": "stream",
"text": [
"INFO: Making API call to ModelChain (2D) endpoint: https://solarfarmer.dnv.com/latest/api/ModelChain\n",
"Start time = 02-03-2026 13:51:33\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 9.0 seconds)\n",
"/home/iantse/git_repos/solarfarmer-api-python-sdk/solarfarmer/models/energy_calculation_results.py:1769: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.\n",
" data[\"date\"] = pd.to_datetime(data[\"date\"], utc=True).dt.tz_localize(None)\n"
"Start time = 05-05-2026 12:13:50\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 5.1 seconds)\n"
]
},
{
Expand All @@ -318,7 +314,7 @@
"Mounting type = Fixed-tilt racks\n",
"AC capacity of system = 0.375 MW\n",
"DC capacity of system = 0.4455 MW\n",
"Run in SolarFarmer API version 6.0.19\n",
"Run in SolarFarmer API version 6.0.21\n",
"-------------------------------------------------------\n",
" Annual Performance Summary (project year 1, 2017)\n",
"------------------------------------- ---------------\n",
Expand Down Expand Up @@ -393,16 +389,16 @@
"output_type": "stream",
"text": [
"INFO: Making API call to ModelChainAsync (3D) endpoint: https://solarfarmer.dnv.com/latest/api/ModelChainAsync\n",
"Start time = 02-03-2026 13:51:43\n",
"INFO: Instance ID returned = Matera-IT_SDK_example_2026-03-02T215144_uf5odlwedl\n",
"INFO: 1: Time: 0:00:03 \tRun status: Running \tCustom status: Calculation pending... [Shading: 0.0%, ModelChain: 0.0%, Overall: 0.0%]\n",
"Start time = 05-05-2026 12:13:59\n",
"INFO: Instance ID returned = Matera-IT_SDK_example_2026-05-05T101359_u2wl4egqtl\n",
"INFO: 1: Time: 0:00:01 \tRun status: Running \tCustom status: Calculation pending... [Shading: 0.0%, ModelChain: 0.0%, Overall: 0.0%]\n",
"INFO: Plant stats: 3D Trackers, AC = 0.84 MW\n",
"INFO: 2: Time: 0:00:14 \tRun status: Running \tCustom status: Calculation pending... [Shading: 0.0%, ModelChain: 0.0%, Overall: 0.0%]\n",
"INFO: 3: Time: 0:00:25 \tRun status: Running \tCustom status: Running model chain calculation (0/46 tasks complete) [Shading: 100.0%, ModelChain: 0.0%, Overall: 35.3%]\n",
"INFO: 4: Time: 0:00:37 \tRun status: Running \tCustom status: Running model chain calculation (0/46 tasks complete) [Shading: 100.0%, ModelChain: 0.0%, Overall: 35.3%]\n",
"INFO: 5: Time: 0:00:48 \tRun status: Running \tCustom status: Running post-processing (0/46 tasks complete) [Shading: 100.0%, ModelChain: 100.0%, Overall: 69.1%]\n",
"INFO: 6: Time: 0:00:59 \tRun status: Completed \tCustom status: Finishing up. [Shading: 100.0%, ModelChain: 100.0%, Overall: 100.0%]\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 69.7 seconds)\n"
"INFO: 2: Time: 0:00:12 \tRun status: Running \tCustom status: Calculation pending... [Shading: 0.0%, ModelChain: 0.0%, Overall: 0.0%]\n",
"INFO: 3: Time: 0:00:22 \tRun status: Running \tCustom status: Running model chain calculation (0/46 tasks complete) [Shading: 100.0%, ModelChain: 0.0%, Overall: 35.3%]\n",
"INFO: 4: Time: 0:00:33 \tRun status: Running \tCustom status: Running model chain calculation (0/46 tasks complete) [Shading: 100.0%, ModelChain: 0.0%, Overall: 35.3%]\n",
"INFO: 5: Time: 0:00:44 \tRun status: Running \tCustom status: Running post-processing (2/46 tasks complete) [Shading: 100.0%, ModelChain: 100.0%, Overall: 70.5%]\n",
"INFO: 6: Time: 0:00:55 \tRun status: Completed \tCustom status: Finishing up. [Shading: 100.0%, ModelChain: 100.0%, Overall: 100.0%]\n",
"INFO: SUCCESS: Calculation returned successfully (time taken: 65.8 seconds)\n"
]
},
{
Expand All @@ -418,7 +414,7 @@
"Mounting type = Single-axis trackers\n",
"AC capacity of system = 0.84 MW\n",
"DC capacity of system = 1.197 MW\n",
"Run in SolarFarmer API version 6.0.19\n",
"Run in SolarFarmer API version 6.0.21\n",
"-------------------------------------------------------\n",
" Annual Performance Summary (project year 1, 2017)\n",
"------------------------------------- ----------------\n",
Expand Down Expand Up @@ -510,7 +506,7 @@
"WARNING: Could not export the file LossTreeResults.tsv due to missing data.\n",
"WARNING: Could not export the file PVsystResults.csv due to missing data.\n",
"WARNING: Could not export the file DetailedTimeseries.tsv due to missing data.\n",
"INFO: Results written out to sample_data/testing_output_456\n"
"INFO: Results written out to sample_data\\testing_output_456\n"
]
}
],
Expand All @@ -530,9 +526,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: The file sample_data/testing_output_456/LossTreeResults.tsv could not be found.\n",
"WARNING: The file sample_data/testing_output_456/PVsystResults.csv could not be found.\n",
"WARNING: The file sample_data/testing_output_456/DetailedTimeseries.tsv could not be found.\n"
"WARNING: The file sample_data\\testing_output_456\\LossTreeResults.tsv could not be found.\n",
"WARNING: The file sample_data\\testing_output_456\\PVsystResults.csv could not be found.\n",
"WARNING: The file sample_data\\testing_output_456\\DetailedTimeseries.tsv could not be found.\n"
]
}
],
Expand Down Expand Up @@ -577,7 +573,7 @@
"Mounting type = Single-axis trackers\n",
"AC capacity of system = 0.84 MW\n",
"DC capacity of system = 1.197 MW\n",
"Run in SolarFarmer API version 6.0.19\n",
"Run in SolarFarmer API version 6.0.21\n",
"-------------------------------------------------------\n",
" Annual Performance Summary (project year 1, 2017)\n",
"------------------------------------- ----------------\n",
Expand Down Expand Up @@ -676,6 +672,7 @@
" energy_yield: 1194.5706976\n",
" net_energy: 1429.9760244\n",
" performance_ratio: 0.8090517\n",
" performance_ratio_bifacial: 0.8090517\n",
"\n",
"Multi-year performance summary:\n"
]
Expand Down Expand Up @@ -710,6 +707,7 @@
" <th>energy_yield</th>\n",
" <th>net_energy</th>\n",
" <th>performance_ratio</th>\n",
" <th>performance_ratio_bifacial</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
Expand All @@ -724,6 +722,7 @@
" <td>1194.570698</td>\n",
" <td>1429.976024</td>\n",
" <td>0.809052</td>\n",
" <td>0.809052</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -736,8 +735,8 @@
" irradiation_on_tilted_plane effective_irradiation energy_yield \\\n",
"0 1476.507246 1388.937528 1194.570698 \n",
"\n",
" net_energy performance_ratio \n",
"0 1429.976024 0.809052 "
" net_energy performance_ratio performance_ratio_bifacial \n",
"0 1429.976024 0.809052 0.809052 "
]
},
"execution_count": 11,
Expand Down Expand Up @@ -1156,7 +1155,7 @@
"PVsyst timeseries: not available\n",
"Detailed timeseries: not available\n",
"\n",
"Calculation attributes: 1.197 MWp DC, 0.84 MWac, SF API v6.0.19\n"
"Calculation attributes: 1.197 MWp DC, 0.84 MWac, SF API v6.0.21\n"
]
}
],
Expand Down Expand Up @@ -1191,7 +1190,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "solarfarmer",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand All @@ -1205,7 +1204,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.13"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
Loading
Loading