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

Histogram in plots.series() #330

Merged
merged 2 commits into from
Oct 12, 2021
Merged

Histogram in plots.series() #330

merged 2 commits into from
Oct 12, 2021

Conversation

martinvonk
Copy link
Collaborator

@martinvonk martinvonk commented Oct 11, 2021

Short Description

old:
axes = ps.plots.series(head=ho, stresses=[p, e], figsize=(8, 5))
image
new:
axes = ps.plots.series(head=ho, stresses=[p, e], hist=True, figsize=(8, 5))
image#

additional function option for bins
axes = ps.plots.series(head=ho, stresses=[p, e], hist=True, figsize=(8, 5))

Checklist before PR can be merged:

Same Codacy Error. Tests pass locally:

================================================= test session starts =================================================
platform win32 -- Python 3.9.7, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir:  configfile: pytest.ini
plugins: anyio-2.2.0, cov-3.0.0
collected 115 items

tests\test_001.py .                                                                                              [  0%]
tests\test_examples.py ............                                                                              [ 11%]
tests\test_gxg.py ..........                                                                                     [ 20%]
tests\test_model.py ......................                                                                       [ 39%]
tests\test_notebooks.py ................                                                                         [ 53%]
tests\test_plots.py ............                                                                                 [ 63%]
tests\test_qgxg.py .........                                                                                     [ 71%]
tests\test_reads.py ....                                                                                         [ 74%]
tests\test_recharge.py .......                                                                                   [ 80%]
tests\test_rfuncs.py ..........                                                                                  [ 89%]
tests\test_solvers.py ........                                                                                   [ 96%]
tests\test_stats.py ....                                                                                         [100%]

================================================== warnings summary ===================================================
..\..\..\miniconda3\envs\pastas_dev\lib\site-packages\win32\lib\pywintypes.py:2
 .\miniconda3\envs\pastas_dev\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp, sys, os

-- Docs: https://docs.pytest.org/en/stable/warnings.html

----------- coverage: platform win32, python 3.9.7-final-0 -----------
Coverage XML written to file coverage.xml

================================================== slowest durations ==================================================
181.11s call     tests/test_notebooks.py::test_notebook[14_timestep_analysis.ipynb]
56.56s call     tests/test_notebooks.py::test_notebook[15_recharge_estimation.ipynb]
53.85s call     tests/test_notebooks.py::test_notebook[11_sgi_example.ipynb]
47.09s call     tests/test_notebooks.py::test_notebook[06_adding_trends.ipynb]
46.35s call     tests/test_recharge.py::test_berendrecht
43.58s call     tests/test_notebooks.py::test_notebook[10_multiple_wells.ipynb]
36.45s call     tests/test_notebooks.py::test_notebook[09_calibration_options.ipynb]
33.89s call     tests/test_notebooks.py::test_notebook[16_uncertainty.ipynb]
21.58s call     tests/test_examples.py::test_example[example_menyanthes.py]
18.77s call     tests/test_notebooks.py::test_notebook[08_threshold_non_linear.ipynb]
18.25s call     tests/test_notebooks.py::test_notebook[05_adding_wells.ipynb]
17.78s call     tests/test_notebooks.py::test_notebook[04_adding_rivers.ipynb]
16.96s call     tests/test_notebooks.py::test_notebook[07_non_linear_recharge.ipynb]
15.75s call     tests/test_notebooks.py::test_notebook[03_diagnostic_checking.ipynb]
14.79s call     tests/test_notebooks.py::test_notebook[01_basic_model.ipynb]
13.79s call     tests/test_notebooks.py::test_notebook[02_fix_parameters.ipynb]
11.28s call     tests/test_examples.py::test_example[example_transform.py]
10.13s call     tests/test_notebooks.py::test_notebook[13_reading_dutch_datasets.ipynb]
8.09s call     tests/test_examples.py::test_example[example_uncertainty.py]
5.29s call     tests/test_examples.py::test_example[example_tarso.py]
4.87s call     tests/test_examples.py::test_example[example_recharge.py]
4.20s call     tests/test_plots.py::test_tracksolve
4.00s call     tests/test_qgxg.py::TestQGXG::test_q_gxg_series
3.67s call     tests/test_examples.py::test_example[example_well.py]
2.71s call     tests/test_recharge.py::test_flexmodel
2.14s call     tests/test_examples.py::test_example[example_step.py]
1.86s call     tests/test_rfuncs.py::test_rfunc[Kleur]
1.82s call     tests/test_examples.py::test_example[example.py]
1.61s call     tests/test_examples.py::test_example[example_docs.py]
1.01s call     tests/test_recharge.py::test_model_solve
0.97s call     tests/test_plots.py::test_compare
0.91s call     tests/test_model.py::test_armamodel
0.90s call     tests/test_plots.py::test_diagnostics
0.89s call     tests/test_solvers.py::test_ci_contribution
0.87s call     tests/test_solvers.py::test_ci_step_response
0.85s call     tests/test_model.py::test_solve_model
0.85s call     tests/test_solvers.py::test_ci_block_response
0.84s call     tests/test_solvers.py::test_least_squares
0.83s call     tests/test_solvers.py::test_pred_interval
0.82s call     tests/test_recharge.py::test_linear
0.82s call     tests/test_solvers.py::test_ci_simulation
0.78s call     tests/test_solvers.py::test_fit_constant
0.74s call     tests/test_plots.py::test_stacked_results
0.67s call     tests/test_plots.py::test_results
0.54s call     tests/test_plots.py::test_decomposition
0.47s call     tests/test_examples.py::test_example[example_timestep_weighted_resample.py]
0.39s call     tests/test_solvers.py::test_no_noise
0.38s call     tests/test_plots.py::test_stresses
0.25s call     tests/test_plots.py::test_plot
0.17s call     tests/test_recharge.py::test_model_copy
0.14s call     tests/test_plots.py::test_contributions_pie
0.14s call     tests/test_plots.py::test_block_response
0.14s call     tests/test_plots.py::test_step_response
0.10s call     tests/test_gxg.py::TestGXG::test_glg
0.10s call     tests/test_rfuncs.py::test_rfunc[Edelman]
0.10s call     tests/test_model.py::test_load_model
0.08s call     tests/test_model.py::test_solve_empty_model
0.08s call     tests/test_model.py::test_residuals
0.08s call     tests/test_model.py::test_noise
0.08s call     tests/test_gxg.py::TestGXG::test_ghg_len_yearly
0.08s call     tests/test_model.py::test_simulate
0.08s call     tests/test_model.py::test_model_copy
0.07s call     tests/test_recharge.py::test_default_model
0.07s call     tests/test_model.py::test_add_stressmodels
0.07s call     tests/test_plots.py::test_add_stressmodel
0.07s call     tests/test_model.py::test_observations
0.07s call     tests/test_model.py::test_get_step
0.07s call     tests/test_model.py::test_get_contribution
0.07s call     tests/test_model.py::test_get_block
0.07s call     tests/test_model.py::test_get_stress
0.07s call     tests/test_model.py::test_del_stressmodel
0.07s call     tests/test_model.py::test_add_stressmodel
0.06s call     tests/test_reads.py::test_read_knmi
0.06s call     tests/test_rfuncs.py::test_rfunc[FourParam]
0.04s call     tests/test_model.py::test_add_noisemodel
0.04s call     tests/test_recharge.py::test_create_rechargemodel
0.04s call     tests/test_model.py::test_add_constant
0.03s call     tests/test_model.py::test_del_noisemodel
0.03s call     tests/test_model.py::test_del_constant
0.03s call     tests/test_model.py::test_save_model
0.03s call     tests/test_model.py::test_create_model
0.03s call     tests/test_reads.py::test_read_waterbase
0.02s call     tests/test_examples.py::test_example[example_logger.py]
0.02s call     tests/test_rfuncs.py::test_rfunc[DoubleExponential]
0.02s call     tests/test_rfuncs.py::test_rfunc[HantushWellModel]
0.02s call     tests/test_rfuncs.py::test_rfunc[Hantush]
0.01s call     tests/test_rfuncs.py::test_rfunc[Polder]
0.01s call     tests/test_rfuncs.py::test_rfunc[Gamma]
0.01s call     tests/test_qgxg.py::TestQGXG::test_q_glg_tmin
0.01s call     tests/test_stats.py::test_acf_gaussian
0.01s call     tests/test_gxg.py::TestGXG::test_ghg
0.01s call     tests/test_reads.py::test_read_dino
0.01s call     tests/test_stats.py::test_acf_rectangle
0.01s call     tests/test_gxg.py::TestGXG::test_glg_fill_limit
0.01s call     tests/test_stats.py::test_stoffer_toloi
0.01s call     tests/test_rfuncs.py::test_rfunc[Exponential]
0.01s call     tests/test_gxg.py::TestGXG::test_glg_fill_limit_null
0.01s call     tests/test_stats.py::test_runs_test
0.01s call     tests/test_gxg.py::TestGXG::test_ghg_ffill
0.01s call     tests/test_gxg.py::TestGXG::test_ghg_linear
0.01s call     tests/test_gxg.py::TestGXG::test_gvg
0.01s call     tests/test_qgxg.py::TestQGXG::test_q_gvg_tmin_tmax
0.01s call     tests/test_reads.py::test_read_dino_level_gauge
0.01s call     tests/test_gxg.py::TestGXG::test_ghg_bfill
0.01s call     tests/test_gxg.py::TestGXG::test_gvg_nan
0.01s call     tests/test_qgxg.py::TestQGXG::test_q_ghg
0.01s call     tests/test_rfuncs.py::test_rfunc[One]
0.01s call     tests/test_qgxg.py::TestQGXG::test_q_gvg
0.01s call     tests/test_qgxg.py::TestQGXG::test_q_ghg_tmax

(236 durations < 0.005s hidden.  Use -vv to show these durations.)
===================================== 115 passed, 1 warning in 726.13s (0:12:06) ======================================

when consulting runs_test() the original Series would be converted to zeros and ones.
Not entirely happy about x-axis sharing for the first column of subplots (Series). Currently is done with: axs[i].get_shared_x_axes().join(axs[i], axs[0]).

Plot now also automatically works with tmin and tmax.
@martinvonk martinvonk changed the base branch from master to dev October 11, 2021 20:49
@martinvonk martinvonk changed the title Dev Histogram in plots.series() Oct 11, 2021
@raoulcollenteur
Copy link
Member

Looking good, thanks for the PR @martinvonk ! And nice catch on the runs-test. Merging :)

@rubencalje
Copy link
Collaborator

Just added some code, together with @martinvonk , so that you can now also call ps.plots.series() from the model as well:

ml.plots.series()

@martinvonk martinvonk self-assigned this Feb 28, 2023
@martinvonk martinvonk added the development Indicates development of new features label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Indicates development of new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants