Skip to content

temp_min_col and temp_max_col should accept column names #1

@timcera

Description

@timcera
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [36], in <cell line: 7>()
    153     bias = np.mean(temp_ts.Tmin - temp_ts_fill.Tmin)
    154     temp_ts["Tmin"].fillna(temp_ts_fill["Tmin"] + bias, inplace=True)
--> 156 temp_disaggregate = met.disaggregate.temperature(
    157     input_ts=temp_ts,
    158     temp_min_col="Tmin",
    159     temp_max_col="Tmax",
    160     method="sine_min_max",
    161     min_max_time="sun_loc",
    162     source_units=["degF", "degF"],
    163     lat=station["Latitude"],
    164     lon=station["Longitude"],
    165     target_units=["degF"],
    166 )
    167 missing_info.iloc[i, 4] = len(temp_ts["Tmax"][temp_ts["Tmax"].isna()])
    168 missing_info.iloc[i, 5] = len(temp_ts["Tmin"][temp_ts["Tmin"].isna()])

File /beohome/a/ScientificProgramSupport/local/pythons/python3.8.6/lib64/python3.8/site-packages/typic/api.py:189, in wrap.<locals>.func_wrapper(*args, **kwargs)
    186 @functools.wraps(func)
    187 def func_wrapper(*args, **kwargs):
    188     args, kwargs = enforcer(*args, **kwargs)
--> 189     return func(*args, **kwargs)

File /beohome/a/ScientificProgramSupport/local/pythons/python3.8.6/lib64/python3.8/site-packages/mettoolbox/disaggregate.py:135, in temperature(method, source_units, min_max_time, mod_nighttime, input_ts, start_date, end_date, dropna, clean, round_index, skiprows, index_type, names, print_input, target_units, max_delta, temp_min_col, temp_max_col, temp_mean_col, lat, lon, hourly)
    133 columns = []
    134 try:
--> 135     temp_min_col = int(temp_min_col)
    136 except TypeError:
    137     pass

ValueError: invalid literal for int() with base 10: 'Tmin'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions