Giter Site home page Giter Site logo

stormcatchments's People

Contributors

ewouth avatar t-ott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ewouth

stormcatchments's Issues

Allow for line-only network initialization

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:

  1. Every first vertex / root node on each line is a flow sink. For example, typical culverts where flow enters on one end, and travels out the flow source on the other end.
  2. Every vertex on each line is a flow sink, except leaf nodes. This would be applicable to line data that has some sort of catchbasin/drop inlet on each vertex.
  3. If neither of these two assumptions are correct for a given directioned line dataset, the user would have to provide some sort of point data to represent where flow can (or cannot) enter subsurface networks.

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.

Better to resolve edge directions as-needed or during initialization?

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.

Change initialization of flow sinks and sources

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.

Move constants to a ```constants.py``` file

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.

Generate reporting for network direction resolution

Reports could be printed to std out or to separate file? Could include info related to:

  • How many outfalls/source points were resolved
  • How many edges were successfully resolved and how many edges failed to resolve
  • If any sections of the network do not have a outfall/source point

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.