Skip to content

Commit b4d4eef

Browse files
committed
lint check by pre-commit in level 3
1 parent 27a7eb2 commit b4d4eef

File tree

16 files changed

+1338
-813
lines changed

16 files changed

+1338
-813
lines changed

AUTHORS.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ This code is developed by:
22

33
Xiaohao Yang
44

5-
This code was developed as part of the xPDFsuite project to create software
6-
and tools for general researchers to use PDF in their work. For more
5+
This code was developed as part of the xPDFsuite project to create software
6+
and tools for general researchers to use PDF in their work. For more
77
information on the DiffPy project email sb2896@columbia.edu

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ INSTALLATION
2626
------------------------------------------------------------------------
2727

2828
We are going to release conda package for all platform. For general user
29-
please use the installation file and install software. For developor,
29+
please use the installation file and install software. For developor,
3030
you can install dpx.srxplanargui using
3131

3232
python setup.py install
33-
34-
Note: the dependency is not specified in the setup.py. You need to install
35-
them yourself. You can use Anaconda or other python enviroment.
33+
34+
Note: the dependency is not specified in the setup.py. You need to install
35+
them yourself. You can use Anaconda or other python enviroment.
3636

3737

3838
CONTACTS

dpx/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
# See LICENSE.txt for license information.
1212
#
1313
##############################################################################
14+
"""Blank namespace package."""
1415

15-
"""
16-
Blank namespace package.
17-
"""
18-
19-
__import__('pkg_resources').declare_namespace(__name__)
16+
__import__("pkg_resources").declare_namespace(__name__)
2017

2118
# End of file

dpx/srxplanargui/calibration.py

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,79 @@
1212
#
1313
##############################################################################
1414

15-
import numpy as np
1615
import os
17-
import sys
1816
import re
17+
import sys
1918

19+
import numpy as np
2020
from traits.etsconfig.api import ETSConfig
21+
2122
ETSConfig.toolkit = 'qt4'
2223

23-
from traits.api import \
24-
Dict, List, Enum, Bool, File, Float, Int, Array, Str, Range, Directory, CFloat, CInt, \
25-
HasTraits, Property, Instance, Event, Button, Any, \
26-
on_trait_change, DelegatesTo, cached_property, property_depends_on
27-
28-
from traitsui.api import \
29-
Item, Group, View, Handler, Controller, spring, Action, \
30-
HGroup, VGroup, Tabbed, \
31-
RangeEditor, CheckListEditor, TextEditor, EnumEditor, ButtonEditor, \
32-
ArrayEditor, TitleEditor, TableEditor, HistoryEditor, InstanceEditor, ImageEditor
33-
from traitsui.menu import ToolBar, OKButton, CancelButton, Menu, MenuBar, OKCancelButtons
24+
from diffpy.srxconfutils.tools import module_exists_lower
25+
from diffpy.srxplanar.selfcalibrate import selfCalibrate
26+
from diffpy.srxplanar.srxplanar import SrXplanar
27+
from diffpy.srxplanar.srxplanarconfig import checkMax
3428
from pyface.api import ImageResource, SplashScreen
29+
from traits.api import (
30+
Any,
31+
Array,
32+
Bool,
33+
Button,
34+
CFloat,
35+
CInt,
36+
DelegatesTo,
37+
Dict,
38+
Directory,
39+
Enum,
40+
Event,
41+
File,
42+
Float,
43+
HasTraits,
44+
Instance,
45+
Int,
46+
List,
47+
Property,
48+
Range,
49+
Str,
50+
cached_property,
51+
on_trait_change,
52+
property_depends_on,
53+
)
54+
from traitsui.api import (
55+
Action,
56+
ArrayEditor,
57+
ButtonEditor,
58+
CheckListEditor,
59+
Controller,
60+
EnumEditor,
61+
Group,
62+
Handler,
63+
HGroup,
64+
HistoryEditor,
65+
ImageEditor,
66+
InstanceEditor,
67+
Item,
68+
RangeEditor,
69+
Tabbed,
70+
TableEditor,
71+
TextEditor,
72+
TitleEditor,
73+
VGroup,
74+
View,
75+
spring,
76+
)
77+
from traitsui.menu import (
78+
CancelButton,
79+
Menu,
80+
MenuBar,
81+
OKButton,
82+
OKCancelButtons,
83+
ToolBar,
84+
)
3585

3686
from dpx.srxplanargui.srxconfig import SrXconfig
37-
from diffpy.srxplanar.srxplanar import SrXplanar
38-
from diffpy.srxplanar.selfcalibrate import selfCalibrate
39-
from diffpy.srxplanar.srxplanarconfig import checkMax
4087

41-
from diffpy.srxconfutils.tools import module_exists_lower
4288
if module_exists_lower('pyfai'):
4389
import pyFAI
4490
missingpyFAI = False
@@ -58,9 +104,7 @@
58104
class CalibrationHandler(Handler):
59105

60106
def closed(self, info, is_ok):
61-
'''
62-
notify main gui to delete current plot in plots list
63-
'''
107+
"""Notify main gui to delete current plot in plots list."""
64108
if is_ok:
65109
info.object.calibration()
66110
return True
@@ -169,7 +213,7 @@ def callPyFAICalibration(self, image=None, dspacefile=None):
169213
self.pythonbin, self.intescript, '-p', ponifile, str(image)]
170214
subprocess.call(intecmd)
171215
self.parsePyFAIoutput(image)
172-
print 'Calibration finished!'
216+
print('Calibration finished!')
173217
return
174218

175219
def parsePyFAIoutput(self, image=None):

dpx/srxplanargui/datacontainer.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,46 @@
1313
##############################################################################
1414

1515
import os
16+
1617
import numpy as np
18+
from traits.api import (
19+
Any,
20+
Array,
21+
Bool,
22+
Button,
23+
CFloat,
24+
CInt,
25+
DelegatesTo,
26+
Dict,
27+
Directory,
28+
Enum,
29+
Event,
30+
File,
31+
Float,
32+
HasTraits,
33+
Instance,
34+
Int,
35+
List,
36+
Property,
37+
Range,
38+
Str,
39+
cached_property,
40+
on_trait_change,
41+
property_depends_on,
42+
)
1743

18-
from traits.api import \
19-
Dict, List, Enum, Bool, File, Float, Int, Array, Str, Range, Directory, CFloat, CInt, \
20-
HasTraits, Property, Instance, Event, Button, Any, \
21-
on_trait_change, DelegatesTo, cached_property, property_depends_on
2244

23-
class DataContainer (HasTraits):
45+
class DataContainer(HasTraits):
2446

2547
# The full path and file name of the file:
2648
fullname = File
2749
# The base file name of the source file:
2850
basename = Property # Str
2951

30-
@property_depends_on('fullname')
31-
def _get_basename (self):
52+
@property_depends_on("fullname")
53+
def _get_basename(self):
3254
return os.path.basename(self.fullname)
3355

34-
if __name__ == '__main__':
56+
57+
if __name__ == "__main__":
3558
test = DataContainer()

dpx/srxplanargui/gitarchive.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
commit = $Format:%H$
33
date = $Format:%ai$
44
timestamp = $Format:%at$
5-
refnames = $Format:%D$
5+
refnames = $Format:%D$

0 commit comments

Comments
 (0)