Skip to content

Commit

Permalink
chore: comment unused reports, rename config item
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdadams committed May 24, 2024
1 parent 65d5101 commit 749257a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/wmrc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@

COUNTIES_ITEMID = "90431cac2f9f49f4bcf1505419583753"

FEATURE_LAYER_ITEMID = "4df06137fb0a45459e49107a5f47a326" #: Beta version
# FEATURE_LAYER_ITEMID = "056bbc52ff3240f6b69666750a61aeff" #: Live version
FACILITIES_LAYER_ITEMID = "4df06137fb0a45459e49107a5f47a326" #: Beta version
# FACILITIES_LAYER_ITEMID = "056bbc52ff3240f6b69666750a61aeff" #: Live version
JOIN_COLUMN = "id_"

COUNTY_LAYER_ITEMID = "ea80c3c34bb147fba462ea100179bf09"
COUNTY_BOUNDARIES_ITEMID = "4d0671aac09347d3a03415632f19ddb3" #: Must include a feature with the name "Out of State"

MATERIALS_LAYER_ITEM_ID = "43c5fe6a798346b6955f549404348f56"

YEAR = 2023
9 changes: 5 additions & 4 deletions src/wmrc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def process(self):
records = self._load_salesforce_data()
facility_summary_df = self._facility_summaries(records).query("data_year == @config.YEAR")
county_summary_df = self._county_summaries(records) #.query("data_year == @config.YEAR")
materials_recycled_df = self._materials_recycled(records)
materials_composted_df = self._materials_composted(records)
# materials_recycled_df = self._materials_recycled(records)
# materials_composted_df = self._materials_composted(records)

#: Facilities on map
facilities_load_count = self._update_facilities(gis, facility_summary_df)
Expand All @@ -162,6 +162,7 @@ def process(self):
#: Materials recycled on dashboard:
#: Truncate and load live data with sf analyses


end = datetime.now()

summary_message = MessageDetails()
Expand Down Expand Up @@ -215,7 +216,7 @@ def _update_facilities(self, gis, facility_summary_df):
)

#: Merge live data with sheet/sf data
live_facility_data = transform.FeatureServiceMerging.get_live_dataframe(gis, config.FEATURE_LAYER_ITEMID)
live_facility_data = transform.FeatureServiceMerging.get_live_dataframe(gis, config.FACILITIES_LAYER_ITEMID)
updated_facility_data = live_facility_data.set_index("id_")
updated_facility_data.update(google_and_sf_data.set_index("id_"))
updated_facility_data.reset_index(inplace=True)
Expand All @@ -242,7 +243,7 @@ def _update_facilities(self, gis, facility_summary_df):
# updated_facility_data.drop(columns=["local_health_department", "uocc_email_address"], inplace=True)

self.skid_logger.info("Truncating and loading...")
updater = load.FeatureServiceUpdater(gis, config.FEATURE_LAYER_ITEMID, self.tempdir_path)
updater = load.FeatureServiceUpdater(gis, config.FACILITIES_LAYER_ITEMID, self.tempdir_path)
load_count = updater.truncate_and_load_features(updated_facility_data)
return load_count

Expand Down

0 comments on commit 749257a

Please sign in to comment.