-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add long tutorial for the DHNx pandapipes workflow #124
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition to dhnx.
As noted with the "suggestion" feature, a folder creation is missing from the script.
Also I got a weird fiona
error which was fixed by rearranging the order of the import to this.
import logging
import math
import numpy as np
import matplotlib.pyplot as plt
from shapely import geometry
from CoolProp.CoolProp import PropsSI
import networkx as nx
from oemof.tools import logger
import pandas as pd
import pandapipes as pp
import osmnx as ox
But maybe that is just me, because in that environment I was still running shapely 1.8 and stuff is weird right now with the switch to shapely 2.0 and how all the other packages handle it.
As a more general note, it would be great to not only have this example script for pandapipes, but actually have a interface function which translates an dhnx network to the required input for pandapipes. That would be much cleaner and more reliable, hopefully
""" | ||
import logging | ||
import math | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import os |
# # Example of exports of the results | ||
|
||
# to excel | ||
with pd.ExcelWriter('results/results_fine.xlsx') as writer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with pd.ExcelWriter('results/results_fine.xlsx') as writer: | |
filepath = 'results/results_fine.xlsx' | |
if not os.path.exists(os.path.dirname(filepath)): | |
os.makedirs(os.path.dirname(filepath)) | |
with pd.ExcelWriter(filepath) as writer: |
The 'results' folder does not exist when the script runs for the first time, so we need to create it here
see title