t-ott / stormcatchments Goto Github PK
View Code? Open in Web Editor NEWStormwater network aware catchment delineation
Home Page: https://stormcatchments.readthedocs.io
License: GNU General Public License v3.0
Stormwater network aware catchment delineation
Home Page: https://stormcatchments.readthedocs.io
License: GNU General Public License v3.0
Use logging
instead of random printing. The network
module in particular could benefit from this, and various debug
logs could make fixing problems easier
One MultiLineString
per multi-outlet network component/subgraph seems more intuitive
Or type(x) is int
sort of statements. See https://stackoverflow.com/questions/152580/whats-the-canonical-way-to-check-for-type-in-python
Want to do:
import stormcatchments as sc
net = sc.Network(params)
instead of current implementation:
net = sc.network.Network(params)
Probably don't want this to happen. Something in the setup.py
needs to change probably, or tests
should be added as a subdirectory of stormcatchments
?
In the case of line (pipe) data that has vertex order that corresponds to flow direction, you may not need to any point data. You would have to make one of two assumptions about the line data without points, though. Either:
One relatively easy way to implement this is to initialize a Network
with lines only, then write some function to create points at every vertex in the line data, using one of the two methods described above.
One option is to initialize Network.G
with bidirectional edges, then have an additional user method call such as net.resolve_directions()
that modifies the object and does that work once, then switch a boolean attribute to mark that as complete. Then when delineating stormcatchments, check to ensure directions have been resolved first.
Make a call to net.draw()
to demonstrate plotting capability
Force user to supply bool
columns for IS_SOURCE
and IS_SINK
. Could also allow user to change these default columns names to something else too, if desired. This should make Network
initialization clearer. If the user hasn't mapped out two bool
columns yet, they can do so with a quick .apply()
, e.g., what's currently done here:
self.pts['IS_SINK'] = self.pts[type_column].apply(
lambda x: True if x in sink_types else False
)
self.pts['IS_SOURCE'] = self.pts[type_column].apply(
lambda x: True if x in source_types else False
)
Maybe these could be included as helper functions, but having multiple ways to initialize sinks/sources is a bit confusing.
Such as SINK_TYPES_VT
and SOURCE_TYPES_VT
, then can access those constants when initializing a Network
with something like:
...
from . import constants
...
net = network.Network(lines, points, sink_types=constants.SINK_TYPES_VT, source_types=constants.SOURCE_TYPES_VT)
And change the parameters sink_types
and source_types
to optional params. If default None
, then check to make sure there's appropriate bool
columns in the input data already.
Then just make calls to get_catchment()
from within Delineate
. This would be helpful so user doesn't have to have an instance of Network
in order to utilize get_catchment()
In an examples
or tutorials
directory in root
For example see recent failed workflow runs
Reports could be printed to std out or to separate file? Could include info related to:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.