This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_layers(layer=None): | |
qinst=QgsProject.instance() | |
lyrs=['perp', 'fwlshift', 'slope_vector'] if not layer else [layer] | |
for name in lyrs: | |
try: | |
for l in qinst.mapLayersByName(name): | |
qinst.removeMapLayer(l.id()) | |
except: | |
print("Layer not found (not an error)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Reduces the diameter of a pipe gradually and calculates pressure at the end of | |
pipe for each value of the diameter. | |
""" | |
import matplotlib # we need matplotlib for plotting later | |
matplotlib.use('Qt5Agg') # Not esential. But QtAgg backend seems to work better for plotting | |
import matplotlib.pyplot as plt # for plotting later | |
from epanettools import epanettools # import epanet package |