Skip to content

Commit 33ef9af

Browse files
committed
release v1.0.0
1 parent 12c8458 commit 33ef9af

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: falmeida-py
3-
version: '0.9'
3+
version: '1.0.0'
44

55
source:
66
path: ..

falmeida_py/bacannot2json.py

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,20 @@
4141
##############################
4242
### fix keys in dictionary ###
4343
##############################
44+
def convert_dictkey(d):
45+
###change all keys in a dict d
46+
return { str(k): convert_dictvalue(v) for k,v in d.items() }
47+
48+
def convert_dictvalue(v):
49+
###if v is a dict do convert_dictkey() for v, else raise v
50+
if isinstance(v, dict):
51+
return convert_dictkey(v)
52+
else:
53+
return v
54+
4455
def stringify_keys(d):
4556
"""Convert a dict's keys to strings if they are not."""
46-
for key in d.keys():
47-
48-
# check inner dict
49-
if isinstance(d[key], dict):
50-
value = stringify_keys(d[key])
51-
else:
52-
value = d[key]
53-
54-
# convert nonstring to string if needed
55-
if not isinstance(key, str):
56-
try:
57-
d[str(key)] = value
58-
except Exception:
59-
try:
60-
d[repr(key)] = value
61-
except Exception:
62-
raise
63-
64-
# delete old key
65-
del d[key]
66-
return d
57+
return convert_dictkey(d)
6758

6859
###############################################
6960
### based on annotations figure sample name ###

falmeida_py/plasmid_function.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def plasmids_stats(bacannot_summary):
8282
bacannot_summary[sample]['plasmid']['plasmidfinder'][seq]['inc_types'] = {}
8383
bacannot_summary[sample]['plasmid']['plasmidfinder'][seq]['identity'] = {}
8484
bacannot_summary[sample]['plasmid']['plasmidfinder'][seq]['accession'] = {}
85+
8586
for index, row in results.iterrows():
86-
contig = row['Contig']
87+
contig = str(row['Contig'])
8788
bacannot_summary[sample]['plasmid']['plasmidfinder'][contig]['inc_types'] = row['Plasmid']
8889
bacannot_summary[sample]['plasmid']['plasmidfinder'][contig]['identity'] = row['Identity']
8990
bacannot_summary[sample]['plasmid']['plasmidfinder'][contig]['accession'] = row['Accession number']

falmeida_py/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
If not, see <http://www.gnu.org/licenses/>.
1515
"""
1616

17-
__version__ = '0.9'
17+
__version__ = '1.0.0'
1818

1919
def get_version():
2020
return __version__

0 commit comments

Comments
 (0)