From 57e4561abcf9285a0bdd21400a194f4437fb4076 Mon Sep 17 00:00:00 2001 From: Zhi Ming Xu Date: Sun, 31 Aug 2025 17:01:16 -0400 Subject: [PATCH] style: fix codespell errors --- README.rst | 2 +- src/diffpy/srxconfutils/config.py | 16 ++++++++-------- src/diffpy/srxconfutils/configtraits.py | 4 ++-- src/diffpy/srxconfutils/tools.py | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index e78479f..b9418be 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ you can install dpx.confutils using python setup.py install Note: the dependency is not specified in the setup.py. You need to install -them yourself. You can use Anaconda or other python enviroment. +them yourself. You can use Anaconda or other python environment. CONTACTS diff --git a/src/diffpy/srxconfutils/config.py b/src/diffpy/srxconfutils/config.py index 77a0afe..7702d40 100644 --- a/src/diffpy/srxconfutils/config.py +++ b/src/diffpy/srxconfutils/config.py @@ -205,7 +205,7 @@ class ConfigBase(object): "fliphorizontal", { "sec": "Beamline", - "h": "filp the image horizontally", + "h": "flip the image horizontally", "n": "?", "co": True, "d": False, @@ -542,8 +542,8 @@ def parseArgs(self, pargs): """Parse args and update the value in self.*option*, this will call the self.args() to parse args, - :param pargs: list of string, arguments to parse, usually - comming from sys.argv + :param pargs: list of string, arguments to parse, usually coming + from sys.argv """ obj = self.args.parse_args(pargs) changedargs = obj.__dict__.keys() @@ -640,7 +640,7 @@ def _postUpdateConfig(self, **kwargs): ########################################################################### def _createConfigFile(self): - """Write output config file if specfied in configuration the + """Write output config file if specified in configuration the filename is specified by self.createconfig.""" if (self.createconfig != "") and (self.createconfig != None): self.writeConfig(self.createconfig, "short") @@ -651,7 +651,7 @@ def _createConfigFile(self): return def writeConfig(self, filename, mode="short", changeconfigfile=True): - """Write config to file. the file is compatiable with python + """Write config to file. the file is compatible with python package ConfigParser. :param filename: string, name of file @@ -662,7 +662,7 @@ def writeConfig(self, filename, mode="short", changeconfigfile=True): if changeconfigfile: self.configfile = os.path.abspath(filename) self._updateSelf() - # func decide if wirte the option to config according to mode + # func decide if write the option to config according to mode # options not present in self._optdata will not be written to config if mode.startswith("s"): mcond = ( @@ -706,7 +706,7 @@ def getHeader(self, title=None, mode="full"): mode, all options with 'a' will be written, in full mode, all options with 'a' or 'f' will be written :return: string, lines with line break that can be directly - writen to a text file + written to a text file """ lines = [] @@ -714,7 +714,7 @@ def getHeader(self, title=None, mode="full"): self._defaultdata["headertitle"] if title == None else title ) lines.append(title) - # func decide if wirte the option to header according to mode + # func decide if write the option to header according to mode # options not present in self._optdata will not be written to header if mode.startswith("s"): mcond = ( diff --git a/src/diffpy/srxconfutils/configtraits.py b/src/diffpy/srxconfutils/configtraits.py index d71b84f..22bcd5c 100644 --- a/src/diffpy/srxconfutils/configtraits.py +++ b/src/diffpy/srxconfutils/configtraits.py @@ -255,8 +255,8 @@ class ConfigBaseTraits(HasTraits, ConfigBase): "sec": "Beamline", "header": "n", "config": "f", - "l": "Filp horizontally", - "h": "filp the image horizontally", + "l": "Flip horizontally", + "h": "flip the image horizontally", "n": "?", "co": True, "d": False, diff --git a/src/diffpy/srxconfutils/tools.py b/src/diffpy/srxconfutils/tools.py index b64baa0..78a339a 100644 --- a/src/diffpy/srxconfutils/tools.py +++ b/src/diffpy/srxconfutils/tools.py @@ -74,9 +74,9 @@ def str2bool(v): def opt2Str(opttype, optvalue): """Turn the value of one option to string, according to the option - type list of values are truned into "value1, value2, value3...". + type list of values are turned into "value1, value2, value3...". - :param opttype: string, type of opitons, for example 'str' or + :param opttype: string, type of options, for example 'str' or 'intlist' :param optvalue: value of the option :return: string, usually stored in ConfigBase.config @@ -111,7 +111,7 @@ def str2Opt(opttype, optvalue): """Convert the string to value of one option, according to the option type. - :param opttype: string, type of opitons, for example 'str' or + :param opttype: string, type of options, for example 'str' or 'intlist' :param optvalue: string, value of the option :return: value of the option, usually stored in ConfigBase.config