from pandas import read_csv import pastas as ps ps.set_log_level("ERROR") def test_create_project(): pr = ps.Project(name="test") return pr def test_project_add_oseries(): pr = test_create_project() obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True, squeeze=True) pr.add_oseries(obs, name="heads", metadata={"x": 0.0, "y": 0}) return pr def test_project_add_stresses(): pr = test_project_add_oseries() prec = 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)
# -*- coding: utf-8 -*- """ This example is meant to show the logger methods of pastas """ import pastas as ps # using the default logger, we will see some infomration in the console: obs = ps.read_dino('data/B58C0698001_1.csv') # when we set the level to WARNING we do not see any output anymore ps.set_log_level('WARNING') # which is just a wrapper around ps.utils.set_console_handler(ps.logger, level='WARNING') obs = ps.read_dino('data/B58C0698001_1.csv') # when we also want log-information saved to file, we add file-handlers ps.utils.add_file_handlers(ps.logger) obs = ps.read_dino('data/B58C0698001_1.csv') # to get the default logger back we initialize it again ps.utils.initialize_logger(ps.logger)