2121
2222from dotenv import load_dotenv
2323
24+ from transfers .thing_transfer import (
25+ transfer_rock_sample_locations ,
26+ transfer_springs ,
27+ transfer_perennial_streams ,
28+ transfer_ephemeral_streams ,
29+ transfer_met_stations ,
30+ transfer_diversion_of_surface_water ,
31+ transfer_lake_pond_reservoir ,
32+ transfer_soil_gas_sample_locations ,
33+ transfer_other_site_types ,
34+ transfer_outfall_wastewater_return_flow ,
35+ )
36+
2437# Load .env file FIRST, before any database imports, to ensure correct port/database settings
2538load_dotenv (override = True )
2639
@@ -374,7 +387,19 @@ def transfer_all(metrics: Metrics) -> list[ProfileArtifact]:
374387 # These create Things and Locations that chemistry/other transfers depend on.
375388 # =========================================================================
376389 non_well_tasks = []
377- gs = globals ()
390+ transfer_functions = {
391+ "springs" : transfer_springs ,
392+ "perennial_streams" : transfer_perennial_streams ,
393+ "ephemeral_streams" : transfer_ephemeral_streams ,
394+ "met_stations" : transfer_met_stations ,
395+ "rock_sample_locations" : transfer_rock_sample_locations ,
396+ "diversion_of_surface_water" : transfer_diversion_of_surface_water ,
397+ "lake_pond_reservoir" : transfer_lake_pond_reservoir ,
398+ "soil_gas_sample_locations" : transfer_soil_gas_sample_locations ,
399+ "other_site_types" : transfer_other_site_types ,
400+ "outfall_wastewater_return_flow" : transfer_outfall_wastewater_return_flow ,
401+ }
402+
378403 for attr in (
379404 "springs" ,
380405 "perennial_streams" ,
@@ -390,7 +415,7 @@ def transfer_all(metrics: Metrics) -> list[ProfileArtifact]:
390415 thing_type = "" .join (part .capitalize () for part in attr .split ("_" ))
391416 attr_name = f"transfer_{ attr } "
392417 if getattr (transfer_options , attr_name ):
393- transfer_func = gs [ attr_name ]
418+ transfer_func = transfer_functions [ attr ]
394419 non_well_tasks .append ((thing_type , transfer_func ))
395420
396421 if non_well_tasks :
0 commit comments