Example #1
0
    def resample():
        msg = "Creation of a Waterframe object:"
        try:
            wf = WaterFrame()
            print(msg, "Done.")
        except ImportError:
            print(msg, "Import Error.")

        msg = "Loading pickle file:"
        wf.from_pickle("tests/data/test_file.pkl")
        if wf.data.empty:
            print(
                msg, "No such file or directory. Please check if exist"
                "tests/data/pickle_file.pkl")
        else:
            print(msg, "Done.")

        msg = "Resampling:"
        wf.resample('W')
        if str(wf.data.index[0]) == "1956-12-02 00:00:00" and \
           str(wf.data.index[1]) == "1956-12-09 00:00:00":
            print(msg, "Done.")
        else:
            print(msg, "Error.")
Example #2
0
    def drop():
        msg = "Creation of a Waterframe object:"
        try:
            wf = WaterFrame()
            print(msg, "Done.")
        except ImportError:
            print(msg, "Import Error.")

        msg = "Loading pickle file:"
        wf.from_pickle("tests/data/pickle_file.pkl")
        if wf.data.empty:
            print(
                msg, "No such file or directory. Please check if exist"
                "tests/data/pickle_file.pkl")
        else:
            print(msg, "Done.")

        msg = "Droping parameters:"
        wf.drop(
            ['DEPTH', 'VEPK', 'VHM0', 'VSMC', 'VTPK', 'VAVT', 'SWHT', 'SWPR'])
        if len(wf.data.keys()) == 5:
            print(msg, "Done.")
        else:
            print(msg, "Error.")