Example #1
0
def test_write_timeseries_file3():
    """ Test write_timeseries_file functionality part 3 - Discharge + Water Use; water use is applied """

    # create water use totals
    wateruse_totals = {
        'January': 2.0,
        'February': 2.0,
        'March': 2.0,
        'April': 3.0,
        'May': 3.0,
        'June': 0.0,
        'July': 4.0,
        'August': 4.0,
        'September': 4.0,
        'October': 5.0,
        'November': 5.0,
        'December': 5.0
    }  
      
    # create test data
    data = fixture["sample_data_dict"]
    
    # apply water use
    data = watertxt.apply_wateruse(watertxt_data = data, wateruse_totals = wateruse_totals)     
    
    # write file
    watertxt.write_timeseries_file(watertxt_data = data, name = "Discharge + Water Use", save_path = os.path.join(os.getcwd(), "tests"), filename = "_q-and-wateruse-timeseries.txt")  
Example #2
0
def test_write_timeseries_file2():
    """ Test write_timeseries_file functionality part 2 - Discharge with only """
      
    # create test data
    data = fixture["sample_data_dict"]
    
    # write file
    watertxt.write_timeseries_file(watertxt_data = data, name = "Discharge", save_path = os.path.join(os.getcwd(), "tests"), filename = "_q-timeseries.txt")