Skip to content

Commit 0b42d25

Browse files
committed
We want a VPD value for every row
1 parent b45d3a5 commit 0b42d25

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

opensensor/collection_apis.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ def get_initial_match_clause(
162162
device_name: str,
163163
start_date: datetime,
164164
end_date: datetime,
165-
resolution: int,
166165
):
167166
if start_date is None:
168167
start_date = datetime.utcnow() - timedelta(days=100)
@@ -188,9 +187,7 @@ def get_vpd_pipeline(
188187
resolution: int,
189188
):
190189
sampling_interval = timedelta(minutes=resolution)
191-
match_clause = get_initial_match_clause(
192-
device_ids, device_name, start_date, end_date, resolution
193-
)
190+
match_clause = get_initial_match_clause(device_ids, device_name, start_date, end_date)
194191
project_projection = _get_project_projection(VPD)
195192

196193
# We ensure both temperature and humidity exist for the calculation of VPD
@@ -212,14 +209,6 @@ def get_vpd_pipeline(
212209
}
213210
}
214211
},
215-
{
216-
"$group": {
217-
"_id": "$group",
218-
"temp": {"$avg": "$temp"},
219-
"rh": {"$avg": "$rh"},
220-
"timestamp": {"$first": "$timestamp"},
221-
}
222-
},
223212
{
224213
"$addFields": {
225214
"satvp": {

0 commit comments

Comments
 (0)