Skip to content
Snippets Groups Projects

Release 2.0

Merged Loraine Gueguen requested to merge todo_release_1.1 into dev
1 file
+ 3
8
Compare changes
  • Side-by-side
  • Inline
+ 6
13
@@ -44,14 +44,12 @@ def parse_input(input_file):
:return:
"""
parsed_sp_dict_list = []
sp_dict_list = []
try:
with open(input_file, 'r') as stream:
try:
yaml_dict = yaml.safe_load(stream)
for k, v in yaml_dict.items():
parsed_sp_dict_list.append(v)
sp_dict_list = yaml.safe_load(stream)
except yaml.YAMLError as err:
logging.critical("Input file is not in YAML format")
sys.exit(err)
@@ -62,7 +60,7 @@ def parse_input(input_file):
logging.critical("The specified input file cannot be read (%s)" % input_file)
sys.exit()
return parsed_sp_dict_list
return sp_dict_list
def filter_empty_not_empty_items(li):
@@ -125,13 +123,9 @@ def get_species_history_id(instance, full_name):
def get_gspecies_string_from_sp_dict(sp_dict):
gspecies = ""
for k, v in sp_dict.items():
for k2, v2 in v.items():
if k2 == "genus":
gspecies = gspecies.lower() + v2
elif k2 == "species":
gspecies = gspecies.lower() + "_" + v2
genus = sp_dict["description"]["genus"]
species = sp_dict["description"]["species"]
gspecies = genus.lower() + "_" + species.lower()
return gspecies
def get_unique_species_str_list(sp_dict_list):
@@ -166,7 +160,6 @@ def get_unique_species_dict_list(sp_dict_list):
unique_species_dict = {}
unique_species_list_of_dict = []
unique_species_genus_species = get_unique_species_str_list(sp_dict_list=sp_dict_list)
for sp in sp_dict_list:
gspecies = get_gspecies_string_from_sp_dict(sp)
Loading