Skip to content

Commit

Permalink
fix: preserve dtypes across paramspace (#1578)
Browse files Browse the repository at this point in the history
* Use itertuples instead of iterrows to preserve dtypes across columns

* Updated tests for paramspace to include dtype check

* black formatting
  • Loading branch information
SichongP committed Apr 21, 2022
1 parent 667ee86 commit 70ce6a0
Show file tree
Hide file tree
Showing 50 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions snakemake/utils.py
Expand Up @@ -693,10 +693,10 @@ def instance_patterns(self):
self.pattern.format(
*(
self.param_sep.join(("{}", "{}")).format(name, value)
for name, value in row.items()
for name, value in row._asdict().items()
)
)
for index, row in self.dataframe.iterrows()
for row in self.dataframe.itertuples(index=False)
)

def instance(self, wildcards):
Expand Down

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'beta': 0.1, 'gamma': 0.99}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'beta': 0.0, 'gamma': 3.9}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'beta': 0.1, 'gamma': 0.99}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'beta': 0.0, 'gamma': 3.9}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'beta': 0.1, 'gamma': 0.99}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'beta': 0.0, 'gamma': 3.9}

This file was deleted.

@@ -0,0 +1 @@
{'beta': 0.0, 'gamma': 3.9, 'alpha': 2}

This file was deleted.

@@ -0,0 +1 @@
{'beta': 0.1, 'gamma': 0.99, 'alpha': 1}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'gamma': 0.99, 'beta': 0.1}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'gamma': 3.9, 'beta': 0.0}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'beta': 0.1, 'gamma': 0.99}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'beta': 0.0, 'gamma': 3.9}

This file was deleted.

@@ -0,0 +1 @@
{'beta': 0.0, 'gamma': 3.9, 'alpha': 2}

This file was deleted.

@@ -0,0 +1 @@
{'beta': 0.1, 'gamma': 0.99, 'alpha': 1}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 1, 'beta': 0.1, 'gamma': 0.99}

This file was deleted.

@@ -0,0 +1 @@
{'alpha': 2, 'beta': 0.0, 'gamma': 3.9}
4 changes: 2 additions & 2 deletions tests/test_paramspace/params.tsv
@@ -1,3 +1,3 @@
alpha beta gamma
1.0 0.1 0.99
2.0 0.0 3.9
1 0.1 0.99
2 0.0 3.9

0 comments on commit 70ce6a0

Please sign in to comment.