-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixBug: not reading comma separated data correctly (#1634)
* fixBug: not reading comma separated data correctly To test: ```python from flopy.utils.datautil import PyListUtil line = '13,14' ``` PyListUtil.split_data_line(line) * test(PyListUtil): add minimal test for split_data_line() Co-authored-by: w-bonelli <wesbonelli@gmail.com>
- Loading branch information
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,5 @@ autotest/.noseids | |
.docs/_notebooks | ||
|
||
*.bak | ||
|
||
**.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
from flopy.utils.datautil import PyListUtil | ||
|
||
|
||
def test_split_data_line(): | ||
# TODO: try to reproduce this: https://github.com/modflowpy/flopy/runs/7581629193?check_suite_focus=true#step:11:1753 | ||
pass | ||
# fixes: https://github.com/modflowpy/flopy/runs/7581629193?check_suite_focus=true#step:11:1753 | ||
|
||
line = "13,14,15, 16, 17," | ||
spl = PyListUtil.split_data_line(line) | ||
exp = ["13", "14", "15", "16", "17"] | ||
assert len(spl) == len(exp) | ||
# whitespace is not removed, todo: can it be? | ||
# or is it needed to support Modflow input file format? | ||
assert all(any([e in s for s in spl]) for e in exp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters