Skip to content

Commit

Permalink
cleaning up logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgleason committed Jan 23, 2025
1 parent a763ee8 commit ed50e6c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions reV/supply_curve/tech_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,12 @@ def map_resource(self, tm_dset, max_workers=None, points_per_worker=10):
n_jobs = len(gid_chunks)
batch_size = 100
n_submitted = 0
logger.info(f"Kicking off {n_jobs} resource mapping jobs.")
n_batches = ceil(n_jobs / batch_size)
n_finished = 0
logger.info(
f"Kicking off {n_jobs} resource mapping jobs in {n_batches} "
"batches."
)
with SpawnProcessPool(max_workers=max_workers, loggers=loggers) as exe:
while n_submitted < n_jobs:
futures = {}
Expand Down Expand Up @@ -401,18 +406,10 @@ def map_resource(self, tm_dset, max_workers=None, points_per_worker=10):
)
] = i
n_submitted += batch_size
logger.info("{n_submitted} jobs submitted.")

with h5py.File(self._excl_fpath, "a") as f:
indices = f[tm_dset]
n_finished = 0
for future in as_completed(futures):
n_finished += 1
logger.info(
"Parallel TechMapping futures collected: "
"{} out of {}".format(n_finished, len(futures))
)

i = futures[future]
result = future.result()

Expand All @@ -430,6 +427,11 @@ def map_resource(self, tm_dset, max_workers=None, points_per_worker=10):
indices[row_slice, col_slice] = result[j].reshape(
result_shape
)
n_finished += 1
logger.info(
"Parallel TechMapping batches completed: "
f"{n_finished} out of {n_batches}"
)

@classmethod
def run(
Expand Down

0 comments on commit ed50e6c

Please sign in to comment.