Skip to content

Commit 2ad8ecf

Browse files
committed
Work on fixing chunk sizes
1 parent 40f3b9b commit 2ad8ecf

2 files changed

Lines changed: 20 additions & 15 deletions

File tree

backend/connectors/nmbgmr/source.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ def get_records(self):
7272
if config.has_bounds():
7373
params["wkt"] = config.bounding_wkt()
7474

75-
if config.site_limit:
76-
params["limit"] = config.site_limit
77-
7875
if not config.sites_only:
7976

8077
if config.parameter.lower() != "waterlevels":
@@ -90,18 +87,18 @@ def get_records(self):
9087
)
9188
if not config.sites_only:
9289
for site in sites:
93-
print(f"Obtaining well data for {site['properties']['point_id']}")
94-
well_data = self._execute_json_request(
95-
_make_url("wells"),
96-
params={"pointid": site["properties"]["point_id"]},
97-
tag="",
98-
)
99-
site["properties"]["formation"] = well_data["formation"]
100-
site["properties"]["well_depth"] = well_data["well_depth_ftbgs"]
101-
site["properties"]["well_depth_units"] = FEET
102-
# site["properties"]["formation"] = None
103-
# site["properties"]["well_depth"] = None
90+
# print(f"Obtaining well data for {site['properties']['point_id']}")
91+
# well_data = self._execute_json_request(
92+
# _make_url("wells"),
93+
# params={"pointid": site["properties"]["point_id"]},
94+
# tag="",
95+
# )
96+
# site["properties"]["formation"] = well_data["formation"]
97+
# site["properties"]["well_depth"] = well_data["well_depth_ftbgs"]
10498
# site["properties"]["well_depth_units"] = FEET
99+
site["properties"]["formation"] = None
100+
site["properties"]["well_depth"] = None
101+
site["properties"]["well_depth_units"] = FEET
105102

106103
return sites
107104

backend/unifier.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,18 @@ def _site_wrapper(site_source, parameter_source, persister, config):
156156
end_ind += n
157157

158158
if use_summarize:
159+
print("summarize")
160+
print(sites_with_records_count, site_limit)
159161
summary_records = parameter_source.read(
160162
sites, use_summarize, start_ind, end_ind
161163
)
162164
if summary_records:
165+
print("here", len(summary_records))
163166
persister.records.extend(summary_records)
167+
sites_with_records_count += len(summary_records)
168+
else:
169+
print("there")
170+
continue
164171
else:
165172
results = parameter_source.read(
166173
sites, use_summarize, start_ind, end_ind
@@ -175,7 +182,8 @@ def _site_wrapper(site_source, parameter_source, persister, config):
175182
persister.timeseries.append((site, records))
176183
persister.sites.append(site)
177184

178-
sites_with_records_count += 1
185+
print("incrementing sites_with_records_count")
186+
sites_with_records_count += 1
179187

180188
except BaseException:
181189
import traceback

0 commit comments

Comments
 (0)