modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
507 stars 307 forks source link

fix(styles): platform evaluation for Linux was incorrect #2188

Closed jdhughes-usgs closed 4 months ago

jdhughes-usgs commented 4 months ago

@wpbonelli I am surprised we haven't caught the issue with flopy.plot.styles on Linux before. platform.platform was being compared to "linux", which as far as I can see is always "Linux". Am I missing something?

mwtoews commented 4 months ago

Another "fix" would be to remove the extra path logic using two style files and just make one style file with a bunch of alternative names for "font.sans-serif". I.e., remove usgsmap_linux.mplstyle and usgsplot_linux.mplstyle and with the two remaining style files, define:

font.sans-serif: Arial, Liberation Sans

and maybe add other possible sans-serif fonts to choose. See this file for default styles.

jdhughes-usgs commented 4 months ago

Another "fix" would be to remove the extra path logic using two style files and just make one style file with a bunch of alternative names for "font.sans-serif". I.e., remove usgsmap_linux.mplstyle and usgsplot_linux.mplstyle and with the two remaining style files, define:

font.sans-serif: Arial, Liberation Sans

and maybe add other possible sans-serif fonts to choose. See this file for default styles.

This is a better approach since it simplifies things. Thanks for the suggestion @mwtoews

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.6%. Comparing base (029a4e1) to head (c4388e2). Report is 17 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2188 +/- ## ========================================= + Coverage 68.3% 70.6% +2.2% ========================================= Files 260 261 +1 Lines 57947 58080 +133 ========================================= + Hits 39611 41022 +1411 + Misses 18336 17058 -1278 ``` | [Files](https://app.codecov.io/gh/modflowpy/flopy/pull/2188?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=modflowpy) | Coverage Δ | | |---|---|---| | [flopy/plot/styles.py](https://app.codecov.io/gh/modflowpy/flopy/pull/2188?src=pr&el=tree&filepath=flopy%2Fplot%2Fstyles.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=modflowpy#diff-ZmxvcHkvcGxvdC9zdHlsZXMucHk=) | `27.2% <ø> (-0.2%)` | :arrow_down: | ... and [141 files with indirect coverage changes](https://app.codecov.io/gh/modflowpy/flopy/pull/2188/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=modflowpy)