hydromodelbuilder's People
hydromodelbuilder's Issues
Replace status bar during mapping code with tqdm package
Need a simple example model for testing and example documentation purposes
Copy/pasted the Campaspe_transient_PEST.py
contents into a notebook to kick off documentation writing.
Split up God class and class file
flopyInterface is currently ~2744 lines long, and as a consequence is hard to read through.
I suggest the following changes:
- Separate the classes defined in the file into separate class files.
- There seems to be analysis/visualization helper methods defined within ModflowModel().
Extract these out into a separate file and import them in as necessary - Remove commented out code
- If certain methods only relate to a specific model implementation (e.g. SFR) then these could be split out into a separate class that inherits from a base class (or we could use composition)
Any other suggestions @mjasher?
Files not being written in reproject.py
When reproject_layer
from reproject.py is called from GDALInterface
, the new reprojected shapefile is not being written to copy_dest
. This works when the module is run standalone but not when called. Need to sort out so that there is a record of transforms and to prevent recalling the reprojection every time GWModelBuilder
class object is being used, i.e. every time a build script is run for a groundwater model.
Note that the function reproject_layer
is still returning a perfectly usable GDAL object that works as expected in mapping the shapefile to the model grid, it is just not keeping the record of the reprojection as is desired.
Consolidate identical array saving functions?
This save_array() function is pretty much identical to the one found in pilotpoints
text_writer.py only functions is list of strings passed
@ConnectedSystems , in text_writer.py I think we need to convert any list objects to str in the "join" calls. In PESTInterface, the file writing was done using objects of type float, int as well as str.
Consolidate file read/write functions
Expanding on issue #8 there are multiple places where identical or near identical methods are being defined which handle file/data reading and writing.
e.g.
These are identical to each other
It would be great if we could consolidate these.
Consolidate text file reading/writing
Hunt down places where file reading/writing occurs, for example here, and replace with consolidated functions
Simplify Radon_EC_Simple into a single function
Currently it is a class which, based on its usage in flopyInterface
, will get recreated every time Calculate_Rn_from_SFR_with_simple_model()
gets called.
Based on this behaviour it would be better for Radon_EC_Simple to get refactored into a single function
Duplicated PEST methods
Certain methods that appear in ModelProperties.py (for e.g., here) and PESTInterface appear to have overlapping intent/functionalities
Could we consolidate these?
Raster to mesh mapping issues
As part of the given spec, a step is to "adjust the height of an inactive cell".
In the context where the current raster is the third one (i.e. Raster 3), the "bottom of this inactive cell should move to become half the height between the bottom of Raster 4 and Raster 1".
I cannot see where this happens in the current version of the function, although
proposed_heights = (top_merge_locs - (next_j * (merge_diff / next_j)))
Looks like it's calculating the height adjustments. For full context (see here)
Additionally, the function as it is currently doesn't appear to check if the new heights are valid (i.e. greater than the minimum thickness value - or should that be greater than or equal to?)
"In the case of it being two overlying inactive cells then it should split them up into three equal parts"
I cannot determine where this happens currently.
Ancillary simplification suggestions:
reclassIsolatedCells()
is like a median filter with an extra step that reclassifies cells with value of -1
if any neighbouring cell is -1
, where -1
is the value that indicates an invalid cell.
Something like the below can be adapted for this purpose, which would drastically reduce the amount of code. Here, it only does the median filtering (replacement of isolated cells with surrounding values) so it needs to be modified to do the invalid neighbour check.
def filter_isolated_cells(arr):
"""
Adapted from:
* https://stackoverflow.com/questions/41550979/fill-holes-with-majority-of-surrounding-values-python
* https://docs.scipy.org/doc/scipy-0.16.1/reference/generated/scipy.ndimage.filters.median_filter.html
"""
labels, count = label(arr)
return ndimage.median_filter(labels, 1)
# End filter_isolated_cells()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.