Closed ashwinvis closed 2 years ago
The first error that you received should of been fixed in commit c9db99cc0db45ee7015c3420c5a31314c60fd261, I just added a new release to PyPI in case you were installing from there.
I've never seen the second error but will try to reproduce.
I don't get the second error any longer. Must have been a side effect of the first one.
I get a lot of warnings like this:
Calculating mean for var: THETA from columns: ['SWC_1_1_1', 'SWC_1_2_1']
WARNING: renaming column G to input_G
Converting vpd from hpa to kpa
Calculating vapor pressure from vapor pressure deficit and air temperature
Calculating dew point temperature from vapor pressure
The input data temporal frequency appears to be less than daily.
Data is being resampled to daily temporal frequency.
Linearly interpolating gaps in energy balance components up to 4 hours when Rn < 0 and up to 2 hours when Rn >= 0.
Filtering days with less then 100.0% or 48/48 sub-daily measurements
WARNING: unable to find/read gridMET file
/home/john/flux-data-qaqc/examples/Basic_usage/gridMET_data/US-Tw3_38.1083N_-121.6417W.csv
Obviously, I haven't edited the .ini files. I suppose somewhere on the docs it is mentioned how to download these files.
I get an error while accessing QaQc.monthly_df
. Is it expected?
---------------------------------------------------------------------------
MergeError Traceback (most recent call last)
/tmp/ipykernel_824070/61093438.py in <module>
----> 1 q.monthly_df
~/src/sandbox/flux-data-qaqc/fluxdataqaqc/qaqc.py in monthly_df(self)
833 """
834 if not self.corrected and self._has_eb_vars:
--> 835 self.correct_data()
836
837 # rename columns to internal names
~/src/sandbox/flux-data-qaqc/fluxdataqaqc/qaqc.py in correct_data(self, meth, et_gap_fill, y, refET, x, fit_intercept)
1126
1127 if meth == 'ebr':
-> 1128 self._ebr_correction()
1129 elif meth == 'br':
1130 self._bowen_ratio_correction()
~/src/sandbox/flux-data-qaqc/fluxdataqaqc/qaqc.py in _ebr_correction(self)
1713 # datetime indices of all remaining null elements
1714 null_dates = df.loc[df.ebr_corr.isnull(), 'ebr_corr'].index
-> 1715 merged = pd.merge(
1716 df, ebr_5day_clim, on='DOY', how='left', right_index=True
1717 )
~/src/sandbox/flux-data-qaqc/venv/lib/python3.8/site-packages/pandas/core/reshape/merge.py in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator, validate)
105 validate: str | None = None,
106 ) -> DataFrame:
--> 107 op = _MergeOperation(
108 left,
109 right,
~/src/sandbox/flux-data-qaqc/venv/lib/python3.8/site-packages/pandas/core/reshape/merge.py in __init__(self, left, right, how, on, left_on, right_on, axis, left_index, right_index, sort, suffixes, copy, indicator, validate)
680 warnings.warn(msg, FutureWarning, stacklevel=3)
681
--> 682 self._validate_specification()
683
684 cross_col = None
~/src/sandbox/flux-data-qaqc/venv/lib/python3.8/site-packages/pandas/core/reshape/merge.py in _validate_specification(self)
1360 )
1361 if self.left_index or self.right_index:
-> 1362 raise MergeError(
1363 'Can only pass argument "on" OR "left_index" '
1364 'and "right_index", not a combination of both.'
MergeError: Can only pass argument "on" OR "left_index" and "right_index", not a combination of both.
I am using pandas v1.3.2, if it helps.
That first warning is because I must have left the path to the gridMET file on my personal machine in the config.ini file but yes since the field was filled in with a path specific to my computer, that WARNING was expected.
The second error you found is due to a change in the pandas merge function with the newer version you are using, the next commit should fix it.
The tutorial runs fine now. We can mark this as solved. Thanks @JohnVolk
c.f. https://github.com/openjournals/joss-reviews/issues/3418