How to use pastas - 10 common examples

To help you get started, we’ve selected a few pastas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pastas / pastas / tests / test_recharge.py View on Github external
def test_create_model():
    obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True,
                   squeeze=True)
    ml = ps.Model(obs, name="Test_Model")
    sm = test_create_rechargemodel()
    ml.add_stressmodel(sm)
    return ml
github pastas / pastas / tests / test_004.py View on Github external
def test_create_model():
    # Import and check the observed groundwater time series
    obs = ps.read_dino('tests/data/dino_gwl_data.csv')

    # Create the time series model
    ml = ps.Model(obs, name="Test_Model")

    # read weather data
    rain = ps.read_knmi('tests/data/knmi_rain_data.txt', variables='RD')
    evap = ps.read_knmi('tests/data/knmi_evap_data.txt', variables='EV24')

    ## Create stress
    sm = ps.StressModel2(stress=[rain, evap], rfunc=ps.Exponential,
                         name='recharge')
    ml.add_stressmodel(sm)

    ## Solve
    ml.solve()

    return ml
github pastas / pastas / tests / test_solvers.py View on Github external
def create_model():
    obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True,
                   squeeze=True)
    rain = read_csv("tests/data/rain.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    evap = read_csv("tests/data/evap.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    ml = ps.Model(obs, name="Test_Model")
    sm = ps.RechargeModel(prec=rain, evap=evap, rfunc=ps.Exponential,
                          name='recharge')
    ml.add_stressmodel(sm)
    return ml
github pastas / pastas / tests / test_recharge.py View on Github external
def test_create_rechargemodel():
    rain = read_csv("tests/data/rain.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    evap = read_csv("tests/data/evap.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    rm = ps.RechargeModel(prec=rain, evap=evap, name='recharge',
                          recharge="Linear")
    return rm
github pastas / pastas / tests / test_solvers.py View on Github external
def create_model():
    obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True,
                   squeeze=True)
    rain = read_csv("tests/data/rain.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    evap = read_csv("tests/data/evap.csv", index_col=0, parse_dates=True,
                    squeeze=True)
    ml = ps.Model(obs, name="Test_Model")
    sm = ps.RechargeModel(prec=rain, evap=evap, rfunc=ps.Exponential,
                          name='recharge')
    ml.add_stressmodel(sm)
    return ml
github pastas / pastas / tests / test_004.py View on Github external
def test_create_model():
    # Import and check the observed groundwater time series
    obs = ps.read_dino('tests/data/dino_gwl_data.csv')

    # Create the time series model
    ml = ps.Model(obs, name="Test_Model")

    # read weather data
    rain = ps.read_knmi('tests/data/knmi_rain_data.txt', variables='RD')
    evap = ps.read_knmi('tests/data/knmi_evap_data.txt', variables='EV24')

    ## Create stress
    sm = ps.StressModel2(stress=[rain, evap], rfunc=ps.Exponential,
                         name='recharge')
    ml.add_stressmodel(sm)

    ## Solve
    ml.solve()

    return ml
github pastas / pastas / tests / test_004.py View on Github external
def test_create_model():
    # Import and check the observed groundwater time series
    obs = ps.read_dino('tests/data/dino_gwl_data.csv')

    # Create the time series model
    ml = ps.Model(obs, name="Test_Model")

    # read weather data
    rain = ps.read_knmi('tests/data/knmi_rain_data.txt', variables='RD')
    evap = ps.read_knmi('tests/data/knmi_evap_data.txt', variables='EV24')

    ## Create stress
    sm = ps.StressModel2(stress=[rain, evap], rfunc=ps.Exponential,
                         name='recharge')
    ml.add_stressmodel(sm)

    ## Solve
    ml.solve()

    return ml
github pastas / pastas / tests / test_004.py View on Github external
def test_create_model():
    # Import and check the observed groundwater time series
    obs = ps.read_dino('tests/data/dino_gwl_data.csv')

    # Create the time series model
    ml = ps.Model(obs, name="Test_Model")

    # read weather data
    rain = ps.read_knmi('tests/data/knmi_rain_data.txt', variables='RD')
    evap = ps.read_knmi('tests/data/knmi_evap_data.txt', variables='EV24')

    ## Create stress
    sm = ps.StressModel2(stress=[rain, evap], rfunc=ps.Exponential,
                         name='recharge')
    ml.add_stressmodel(sm)

    ## Solve
    ml.solve()

    return ml
github pastas / pastas / tests / test_rfuncs.py View on Github external
def test_rfunc(rfunc_name):
    if rfunc_name not in []:
        obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True,
                       squeeze=True)
        rain = read_csv("tests/data/rain.csv", index_col=0, parse_dates=True,
                        squeeze=True)
        evap = read_csv("tests/data/evap.csv", index_col=0, parse_dates=True,
                        squeeze=True)
        # Create the time series model
        ml = ps.Model(obs, name="Test_Model")

        ## Create stress
        rfunc = getattr(ps.rfunc, rfunc_name)
        sm = ps.StressModel2(stress=[rain, evap], rfunc=rfunc, name='test_sm')
        ml.add_stressmodel(sm)

        # Solve the time series model
        ml.solve()
github pastas / pastas / examples / reads / test_read_series.py View on Github external
"""

@author: ruben

"""

import pastas as ps

fname = '../data/B32D0136001_1.csv'
obs = ps.read_dino(fname)

fname = '../data/KNMI_Bilt.txt'
stress = ps.read_knmi(fname, 'EV24')

obs.plot()
stress.plot()