Skip to content
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

Update to version 0.7.0 #273

Merged
merged 197 commits into from
Oct 24, 2023
Merged

Update to version 0.7.0 #273

merged 197 commits into from
Oct 24, 2023

Conversation

OnnoEbbens
Copy link
Collaborator

No description provided.

dbrakenhoff and others added 30 commits June 16, 2023 11:13
- use chunks and dask delayed to keep memory usage efficient
- get_geotop now gets raw data
- add deprecationwarning to get_geotop_raw_within_extent()
- now takes geotop_ds as input to convert to layers (not extent)
- do not use sortby but check diff of y dimension and flip if necessary
- use .values instead of .data to load data into memory if using dask
- undo onno changes for now w missing strat code
- add kwarg delayed, if False, load data into memory, else return data array with delayed dask arrays
- add kwarg chunked, if True, chunk data array with chunks="auto"
- add x,y data to vertex grid data array
- add function name in all cases
- add line number when level is DEBUG
- use .values to deal with dask arrays
- use get_geotop
- update docstring
* fix for #199

* fix

* return da in some situations

---------

Co-authored-by: Ruben Caljé <r.calje@artesia-water.nl>
Small fix for Error: Assigning CRS to a GeoDataFrame without a geometry column is not supported
nlmod/dims/layers.py Outdated Show resolved Hide resolved
nlmod/gwf/gwf.py Outdated Show resolved Hide resolved
when it is None. The default is None.
finf :float, str or array-like
The applied infiltration rate of the UZF cell (:math:`LT^{-1}`). When passed as
string, the array is obtained from ds. The default is "recharge".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to name this "recharge" by default or should it be precipitation? Recharge implies we already include evaporation somehow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also set the default to None so the user has to decide what data should be used?

nlmod/read/rws.py Outdated Show resolved Hide resolved
nlmod/util.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@dbrakenhoff dbrakenhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lot's of great improvements :)! I made a few minor comments, nothing major. These could also be converted into issues to deal with in a next version.

@dbrakenhoff
Copy link
Collaborator

I think we should just use our admin powers to ignore issues on codacy, or somehow add some of the issues it raises to the ignore list. Most of them aren't really an issue or worth fixing.

@dbrakenhoff
Copy link
Collaborator

Has #261 been fixed yet? It would be good to get that one done before this release I think.

@OnnoEbbens
Copy link
Collaborator Author

I fixed most of the codacy errors. Some ideas/remarks/questions:

  • I disabled the too_complex pattern and the too_many_branches patterns because that are often hard to solve. However I think the checks are good indicators of code that is hard to read so I feel conflicted about disabling them.
  • While looking through some files I notice many functions miss a docstring. See functions in dcs.py, geotop.py and regis.py. I think we should enforce docstrings.
  • @bdestombe: {} is preferred over dict() according to the codacy style checker. I already fixed this but I think it is good to know for future commits.
  • @dbrakenhoff: can you check this codacy error, maybe replace pass with ...:
nlmod/util.py
Medium icon Medium Code Style
Unnecessary pass statement

pass
  • @dbrakenhoff: can you check this codacy error, I cannot figure out if we can ignore this:
nlmod/dims/base.py
Minor icon Minor Code Style
bad operand type for unary ~: NoneType (invalid-unary-operand-type)

data[lay, mask] = data[lay, ~mask][i]
nlmod/dims/base.py
Minor icon Minor Code Style
bad operand type for unary ~: NoneType (invalid-unary-operand-type)

data[mask] = data[~mask, i]
  • @rubencalje: can you check this codacy error (and add a docstring for the dataframe_to_flopy_timeseries function?):
nlmod/dims/time.py
Minor icon Minor Code Style
Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)

def dataframe_to_flopy_timeseries(
  • @rubencalje: can you check this codacy error? Should we add skimage as a dependency?
nlmod/read/rws.py
Minor icon Minor Code Style
Import outside toplevel (skimage.morphology.reconstruction) (import-outside-toplevel)

from skimage.morphology import reconstruction

@OnnoEbbens
Copy link
Collaborator Author

Suddenly a new check: too-many_statements appeared. I decided to ignore that one

@dbrakenhoff
Copy link
Collaborator

The ~ issues can be ignored. I'm not sure how to avoid the check being triggered for these cases.

OnnoEbbens and others added 7 commits October 23, 2023 10:38
* Add nhi.py and test

* Improve nhi.py

* Small changes (unrelated to buisdrainage)

* Add some options to modpath

* Fix Issue #261

* Fix codacy stuff and improve some testst

* Fix the unit of the conductance of buisdrainage

* Fix test

* some minor fixes
- added one docstring, fixed some typos, sort imports

* Add docstrings to nhi

* Replace seasons by winter_name and summer_name in surface_water.py

* Remove warnings and and output from unsaturated notebooks

---------

Co-authored-by: Davíd Brakenhoff <d.brakenhoff@artesia-water.nl>
@rubencalje rubencalje merged commit bf21f20 into main Oct 24, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants