Skip to content

(hotfix): avoid error with large totim in returning budget dataframes#1677

Merged
jdhughes-dev merged 4 commits into
modflowpy:developfrom
mnfienen:hotfix_dataframe_datetimes
Jan 23, 2023
Merged

(hotfix): avoid error with large totim in returning budget dataframes#1677
jdhughes-dev merged 4 commits into
modflowpy:developfrom
mnfienen:hotfix_dataframe_datetimes

Conversation

@mnfienen
Copy link
Copy Markdown
Contributor

When totim is very large (like hundreds of years) the get_dataframes method for mflistfile fails when trying to convert totime to a pandas.datetime object. This fix just uses a try-except to try converting to datetime and, if fails, just leaves totim as a float. @jlarsen-usgs - are there other methods that return dataframes with a time index? I suggest this fix could apply for them as well.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 10, 2023

Codecov Report

Merging #1677 (99109c1) into develop (d99e0cc) will increase coverage by 0.2%.
The diff coverage is 77.7%.

@@            Coverage Diff            @@
##           develop   #1677     +/-   ##
=========================================
+ Coverage     71.6%   71.8%   +0.2%     
=========================================
  Files          253     253             
  Lines        55881   55885      +4     
=========================================
+ Hits         40053   40178    +125     
+ Misses       15828   15707    -121     
Impacted Files Coverage Δ
flopy/utils/mflistfile.py 70.7% <50.0%> (-0.3%) ⬇️
flopy/modpath/mp7.py 85.0% <100.0%> (+<0.1%) ⬆️
flopy/utils/gridutil.py 98.4% <0.0%> (+0.7%) ⬆️
flopy/utils/binaryfile.py 80.1% <0.0%> (+2.8%) ⬆️
flopy/utils/compare.py 30.4% <0.0%> (+12.7%) ⬆️

@jdhughes-dev
Copy link
Copy Markdown
Contributor

You just need to run isort and black on this PR.

mwtoews and others added 3 commits January 20, 2023 10:51
* update(Modpath7): update path construction for modflow model files in nam file

* create relative path to flow model from modpath sim path
@mnfienen mnfienen marked this pull request as ready for review January 20, 2023 22:33
@jdhughes-dev jdhughes-dev merged commit f017c0d into modflowpy:develop Jan 23, 2023
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