Commit 8154eace authored by Hans Roelofsen's avatar Hans Roelofsen
Browse files

requested species now as list instead of set

parent 9ffc1299
......@@ -21,14 +21,15 @@ with open(pkl_src, 'rb') as handle:
doren = pickle.load(handle)
doren.base_out_dir = r'./c_out'
doren.get_requested_species(src='./req_species/soortenlijst.csv')
# Determine subset of requested species to proces
sel = np.array_split(np.arange(0, len(doren.requested_species)), n_batches)[batch_nr].tolist()
sel = np.array_split(np.arange(0, len(doren.req_sp)), n_batches)[batch_nr].tolist()
print('Commencing processing of {0} species...'.format(len(sel)))
# Process subset of requested species
for i, j in enumerate(sel, start=1):
sp = list(doren.req_sp)[j]
sp = doren.req_sp[j]
try:
print(' doing species {0} of {1}: {2}'.format(i, len(sel), sp))
doren.select_plts_w_species(species_name=sp)
......
......@@ -140,9 +140,10 @@ class Doren:
self.request_df = reqs
# Update attributes
self.req_sp = set(self.request_df.species_name_hdr)
self.req_found = self.species.intersection(self.req_sp)
self.req_not_found = self.req_sp.difference(self.species)
req_sp_set = set(self.request_df.species_name_hdr)
self.req_sp = list(req_sp_set)
self.req_found = self.species.intersection(req_sp_set)
self.req_not_found = req_sp_set.difference(self.species)
msg = 'Read {0} species requested for processing, of which {1} match a species in EVA and {2} do not.'.format(
len(self.req_sp), len(self.req_found), len(self.req_not_found))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment