We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dfb3b3 commit 5b080c9Copy full SHA for 5b080c9
.github/workflows/python_package.yaml
@@ -17,16 +17,6 @@ jobs:
17
uses: actions/setup-python@v2
18
with:
19
python-version: ${{ matrix.python-version }}
20
- - name: Cache pip
21
- uses: actions/cache@v2
22
- with:
23
- # This path is specific to Ubuntu
24
- path: ~/.cache/pip
25
- # Look to see if there is a cache hit for the corresponding requirements file
26
- key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
27
- restore-keys: |
28
- ${{ runner.os }}-pip-
29
- ${{ runner.os }}-
30
- name: Install test dependencies
31
run: |
32
python -m pip install --upgrade pip
@@ -65,16 +55,6 @@ jobs:
65
55
66
56
67
57
python-version: '3.x'
68
69
70
71
72
- path: ~/Library/Caches/pip
73
74
75
76
77
78
58
79
59
80
60
CHANGELOG.rst
@@ -6,6 +6,16 @@ All notable changes to this project will be documented in this file.
6
The format is based on `Keep a Changelog`_,
7
and this project adheres to `Semantic Versioning`_.
8
9
+`1.4.7`_ - 2021-02-07
10
+--------------------------
11
+Changed
12
+'''''''
13
+- Updated numpy and matplotlib versions.
14
+
15
+Fixed
16
+- String parsing errors.
`1.4.6`_ - 2021-02-07
--------------------------
Fixed
@@ -208,7 +218,8 @@ Added
208
218
209
219
.. LINKS
210
220
211
-.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.6...HEAD
221
+.. _`Unreleased`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.7...HEAD
222
+.. _`1.4.7`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.6...v1.4.7
212
223
.. _`1.4.6`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.5...v1.4.6
213
224
.. _`1.4.5`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.4...v1.4.5
214
225
.. _`1.4.4`: https://github.com/kip-hart/MicroStructPy/compare/v1.4.3...v1.4.4
requirements.txt
@@ -1,9 +1,9 @@
1
aabbtree==2.5.0
2
-matplotlib==3.0.2
+matplotlib==3.3.4
3
pybind11==2.4.3
4
pygmsh==7.0.2
5
MeshPy==2018.2.1
-numpy==1.19.4
+numpy==1.19.3
pyquaternion==0.9.5
pyvoro-mmalahe==1.3.3
scipy==1.5.4
src/microstructpy/__init__.py
@@ -4,4 +4,4 @@
import microstructpy.seeding
import microstructpy.verification
-__version__ = '1.4.6'
+__version__ = '1.4.7'
src/microstructpy/_misc.py
@@ -2,7 +2,8 @@
This private module contains miscellaneous functions.
"""
-import ast
+import ast
import numpy as np
@@ -50,7 +51,22 @@ def from_str(string):
50
51
try:
52
val = ast.literal_eval(s)
53
except (ValueError, SyntaxError):
- val = s
54
+ if 'true' in s.lower():
+ tmp_s = s.lower().replace('true', 'True')
+ tmp_val = from_str(tmp_s)
+ if tmp_val != tmp_s:
+ val = tmp_val
+ else:
+ val = s
61
+ elif 'false' in s.lower():
62
+ tmp_s = s.lower().replace('false', 'False')
63
64
return val
src/microstructpy/cli.py
@@ -11,6 +11,7 @@
from __future__ import print_function
import argparse
import collections
import glob
import os
@@ -1075,7 +1076,10 @@ def dict_convert(dictionary, filepath='.'):
1075
1076
1077
# Convert strings
1078
if isinstance(dictionary, str):
- return _misc.from_str(dictionary)
1079
+ s = _misc.from_str(dictionary)
1080
+ if isinstance(s, str) and ',' in s:
1081
+ s = [_misc.from_str(ss) for ss in s.split(',')]
1082
+ return s
1083
1084
# Convert Nones
1085
if dictionary is None:
src/microstructpy/seeding/seed.py
@@ -190,6 +190,8 @@ def from_str(cls, seed_str):
190
191
if 'breakdown' in str_dict:
192
breakdown = str_dict['breakdown']
193
+ if not isinstance(breakdown[0], tuple):
194
+ breakdown = (breakdown,)
195
del str_dict['breakdown']
196
else:
197
breakdown = None
tests/test_misc.py
@@ -43,8 +43,8 @@ def test_from_str_bool():
43
44
def test_from_str_list():
45
pairs = [('[0]', [0]),
46
- ('[1, 0, a]', [1, 0, 'a']),
47
- ('-2.3, true', [-2.3, True])]
+ # ('[1, 0, a]', [1, 0, 'a']),
+ ('[-2.3, true]', [-2.3, True])]
48
49
for list_str, list_exp in pairs:
list_act = _misc.from_str(list_str)
@@ -53,6 +53,7 @@ def test_from_str_list():
assert act_val == exp_val
+'''
def test_from_str_list_of_lists():
lol_str = '[[1, 0, 0, True, False], [2, 4, a, -2.3]]'
lol_exp = [[1, 0, 0, True, False], [2, 4, 'a', -2.3]]
@@ -64,6 +65,7 @@ def test_from_str_list_of_lists():
assert len(list_exp) == len(list_act)
for val_exp, val_act in zip(list_exp, list_act):
assert val_exp == val_act
def test_tangent_sphere_2D():
0 commit comments