refresh patch series
Picca Frédéric-Emmanuel
3 years ago
6 | 6 | 1 file changed, 1 insertion(+), 1 deletion(-) |
7 | 7 | |
8 | 8 | diff --git a/doc/source/conf.py b/doc/source/conf.py |
9 | index c8f0991..2726cbd 100644 | |
9 | index cad17ee..f358e8d 100644 | |
10 | 10 | --- a/doc/source/conf.py |
11 | 11 | +++ b/doc/source/conf.py |
12 | @@ -116,7 +116,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | |
12 | @@ -115,7 +115,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] | |
13 | 13 | # Theme options are theme-specific and customize the look and feel of a theme |
14 | 14 | # further. For a list of options available for each theme, see the |
15 | 15 | # documentation. |
6 | 6 | 1 file changed, 10 insertions(+), 11 deletions(-) |
7 | 7 | |
8 | 8 | diff --git a/doc/source/conf.py b/doc/source/conf.py |
9 | index 2726cbd..ce7bc8f 100644 | |
9 | index f358e8d..cc1dde6 100644 | |
10 | 10 | --- a/doc/source/conf.py |
11 | 11 | +++ b/doc/source/conf.py |
12 | @@ -37,8 +37,7 @@ extensions = [ | |
12 | @@ -36,8 +36,7 @@ extensions = [ | |
13 | 13 | 'sphinx.ext.coverage', |
14 | 14 | 'sphinx.ext.mathjax', |
15 | 15 | 'sphinx.ext.viewcode', |
19 | 19 | |
20 | 20 | # Add any paths that contain templates here, relative to this directory. |
21 | 21 | templates_path = ['_templates'] |
22 | @@ -281,12 +280,12 @@ texinfo_documents = [ | |
22 | @@ -280,12 +279,12 @@ texinfo_documents = [ | |
23 | 23 | # would mean that specific document would be compressed |
24 | 24 | # regardless of the global pdf_compressed setting. |
25 | 25 | |
26 | 26 | -pdf_documents = [ |
27 | 27 | - ('index', |
28 | - u'xrayutilities', | |
29 | - u'xrayutilities', | |
30 | - u'Dominik Kriegner\\Eugen Wintersberger'), | |
28 | - 'xrayutilities', | |
29 | - 'xrayutilities', | |
30 | - 'Dominik Kriegner\\Eugen Wintersberger'), | |
31 | 31 | -] |
32 | 32 | +# pdf_documents = [ |
33 | 33 | +# ('index', |
38 | 38 | |
39 | 39 | # A comma-separated list of custom stylesheets. Example: |
40 | 40 | # pdf_stylesheets = ['sphinx','kerning','a4'] |
41 | @@ -297,7 +296,7 @@ pdf_documents = [ | |
41 | @@ -296,7 +295,7 @@ pdf_documents = [ | |
42 | 42 | # Create a compressed PDF |
43 | 43 | # Use True/False or 1/0 |
44 | 44 | # Example: compressed=True |
47 | 47 | |
48 | 48 | # A colon-separated list of folders to search for fonts. Example: |
49 | 49 | # pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/'] |
50 | @@ -345,11 +344,11 @@ pdf_compressed = True | |
50 | @@ -344,11 +343,11 @@ pdf_compressed = True | |
51 | 51 | # pdf_splittables = False |
52 | 52 | |
53 | 53 | # Set the default DPI for images |
56 | 56 | |
57 | 57 | # Enable rst2pdf extension modules (default is only vectorpdf) |
58 | 58 | # you need vectorpdf if you want to use sphinx's graphviz support |
59 | -pdf_extensions = ['inkscape', 'vectorpdf'] | |
60 | +# pdf_extensions = ['inkscape', 'vectorpdf'] | |
59 | -pdf_extensions = [] | |
60 | +# pdf_extensions = [] | |
61 | 61 | |
62 | 62 | # Page template name for "regular" pages |
63 | 63 | # pdf_page_template = 'cutePage' |
6 | 6 | 1 file changed, 3 insertions(+), 3 deletions(-) |
7 | 7 | |
8 | 8 | diff --git a/setup.py b/setup.py |
9 | index de19937..70c2266 100644 | |
9 | index 519ef2d..5855cac 100644 | |
10 | 10 | --- a/setup.py |
11 | 11 | +++ b/setup.py |
12 | @@ -154,8 +154,8 @@ try: | |
12 | @@ -152,8 +152,8 @@ try: | |
13 | 13 | # make sure the python path is pointing to the newly built |
14 | 14 | # code so that the documentation is built on this and not a |
15 | 15 | # previously installed version |
20 | 20 | try: |
21 | 21 | sphinx.setup_command.BuildDoc.run(self) |
22 | 22 | except UnicodeDecodeError: |
23 | @@ -164,7 +164,7 @@ try: | |
23 | @@ -162,7 +162,7 @@ try: | |
24 | 24 | " source path with non-ASCII characters. Please" |
25 | 25 | " try to move the source package to another" |
26 | 26 | " location (path with *only* ASCII characters)") |
6 | 6 | 1 file changed, 5 insertions(+) |
7 | 7 | |
8 | 8 | diff --git a/doc/source/conf.py b/doc/source/conf.py |
9 | index ce7bc8f..a52001e 100644 | |
9 | index cc1dde6..fb52bcd 100644 | |
10 | 10 | --- a/doc/source/conf.py |
11 | 11 | +++ b/doc/source/conf.py |
12 | @@ -241,6 +241,11 @@ man_pages = [ | |
12 | @@ -240,6 +240,11 @@ man_pages = [ | |
13 | 13 | # man_show_urls = False |
14 | 14 | |
15 | 15 |
0 | From: Dominik Kriegner <dominik.kriegner@gmail.com> | |
1 | Date: Wed, 5 Aug 2020 18:25:13 +0200 | |
2 | Subject: workaround bug in scipy >= 1.5.0 | |
3 | ||
4 | --- | |
5 | lib/xrayutilities/q2ang_fit.py | 4 +++- | |
6 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
7 | ||
8 | diff --git a/lib/xrayutilities/q2ang_fit.py b/lib/xrayutilities/q2ang_fit.py | |
9 | index e9a190d..1cb6798 100644 | |
10 | --- a/lib/xrayutilities/q2ang_fit.py | |
11 | +++ b/lib/xrayutilities/q2ang_fit.py | |
12 | @@ -69,7 +69,9 @@ def _makebounds(boundsin): | |
13 | else: | |
14 | raise InputError('bound values must have two or one elements') | |
15 | elif isinstance(b, numbers.Number): | |
16 | - boundsout.append((b, b)) # variable fixed | |
17 | + # boundsout.append((b, b)) # variable fixed | |
18 | + # due to a bug in scipy >= 1.5.0 we need to allow a small variation | |
19 | + boundsout.append((b-config.EPSILON, b+config.EPSILON)) | |
20 | elif b is None: | |
21 | boundsout.append((None, None)) # no bound | |
22 | else: |
0 | From: Dominik Kriegner <dominik.kriegner@gmail.com> | |
1 | Date: Thu, 6 Aug 2020 15:33:53 +0200 | |
2 | Subject: issue #101: convert to scipy.optimize.Bounds and circumvent scipy | |
3 | bug | |
4 | ||
5 | --- | |
6 | lib/xrayutilities/q2ang_fit.py | 24 ++++++++++++++++-------- | |
7 | 1 file changed, 16 insertions(+), 8 deletions(-) | |
8 | ||
9 | diff --git a/lib/xrayutilities/q2ang_fit.py b/lib/xrayutilities/q2ang_fit.py | |
10 | index 1cb6798..8d6dcb3 100644 | |
11 | --- a/lib/xrayutilities/q2ang_fit.py | |
12 | +++ b/lib/xrayutilities/q2ang_fit.py | |
13 | @@ -59,25 +59,32 @@ def _makebounds(boundsin): | |
14 | bounds to be handed over to the scipy.minimize routine. The function | |
15 | will expand fixed values to two equal bounds | |
16 | """ | |
17 | - boundsout = [] | |
18 | + lb = [] | |
19 | + ub = [] | |
20 | for b in boundsin: | |
21 | if isinstance(b, (tuple, list, numpy.ndarray)): | |
22 | if len(b) == 2: | |
23 | - boundsout.append((b[0], b[1])) | |
24 | + lb.append(b[0]) | |
25 | + ub.append(b[1]) | |
26 | elif len(b) == 1: | |
27 | - boundsout.append((b[0], b[0])) | |
28 | + # due to a bug in scipy >= 1.5.0 we need to allow a small | |
29 | + # variation | |
30 | + lb.append(b[0]-1000*config.EPSILON) | |
31 | + ub.append(b[0]+1000*config.EPSILON) | |
32 | else: | |
33 | raise InputError('bound values must have two or one elements') | |
34 | elif isinstance(b, numbers.Number): | |
35 | # boundsout.append((b, b)) # variable fixed | |
36 | # due to a bug in scipy >= 1.5.0 we need to allow a small variation | |
37 | - boundsout.append((b-config.EPSILON, b+config.EPSILON)) | |
38 | + lb.append(b-1000*config.EPSILON) | |
39 | + ub.append(b+1000*config.EPSILON) | |
40 | elif b is None: | |
41 | - boundsout.append((None, None)) # no bound | |
42 | + lb.append(-np.inf) | |
43 | + ub.append(np.inf) | |
44 | else: | |
45 | raise InputError('bound value is of invalid type (%s)' % type(b)) | |
46 | ||
47 | - return tuple(boundsout) | |
48 | + return scipy.optimize.Bounds(lb, ub) | |
49 | ||
50 | ||
51 | def _errornorm_q2ang(angles, qvec, hxrd, U=numpy.identity(3)): | |
52 | @@ -204,10 +211,11 @@ def Q2AngFit(qvec, expclass, bounds=None, ormat=numpy.identity(3), | |
53 | elif len(bounds) != nangles: | |
54 | raise ValueError("XU.Q2AngFit: number of specified bounds invalid") | |
55 | ||
56 | + sbounds = _makebounds(bounds) | |
57 | # perform optimization | |
58 | res = scipy.optimize.minimize(_errornorm_q2ang, start, | |
59 | args=(lqvec, expclass, ormat), | |
60 | - method='SLSQP', bounds=_makebounds(bounds), | |
61 | + method='SLSQP', bounds=sbounds, | |
62 | constraints=constraints, | |
63 | options={'maxiter': 1000, | |
64 | 'eps': config.EPSILON, | |
65 | @@ -221,7 +229,7 @@ def Q2AngFit(qvec, expclass, bounds=None, ormat=numpy.identity(3), | |
66 | res = scipy.optimize.minimize(_errornorm_q2ang, res.x, | |
67 | args=(lqvec, expclass, ormat), | |
68 | method='SLSQP', | |
69 | - bounds=_makebounds(bounds), | |
70 | + bounds=sbounds, | |
71 | constraints=constraints, | |
72 | options={'maxiter': 1000, | |
73 | 'eps': config.EPSILON, |