Skip to content

Commit 938489f

Browse files
author
Dorian Birraux
committed
Fix lots of typos
1 parent b326d63 commit 938489f

File tree

16 files changed

+32
-49
lines changed

16 files changed

+32
-49
lines changed

docs/docpages/intro.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Session management
246246

247247
It is highly recommended to initialize a session once and for all to mitigate the initialization cost.
248248

249-
Delegate the handling of the lifecycle of a session using a `with` block::
249+
Delegate the handling of the life-cycle of a session using a `with` block::
250250

251251
>>> with WolframLanguageSession('/path/to/kernel-executable') as wl_session:
252252
... wl_session.StringReverse('abc')
@@ -268,7 +268,7 @@ Manually terminate the session::
268268
>>> session.terminate()
269269

270270
.. note::
271-
nonterminated sessions usually result in orphan kernel processes, which ultimately lead to the inability to spawn any usable instance at all. Typically, this ends up with a WolframKernelException raised after a failure to communicate with the kernel.
271+
non-terminated sessions usually result in orphan kernel processes, which ultimately lead to the inability to spawn any usable instance at all. Typically, this ends up with a WolframKernelException raised after a failure to communicate with the kernel.
272272

273273
.. note ::
274274
for in-depth explanations and use cases of local evaluation, refer to :ref:`the advanced usage section<adv-local-evaluation>`.
@@ -486,7 +486,7 @@ Create a :class:`~wolframclient.evaluation.WolframAPICall` targeting the API::
486486

487487
>>> api_call = WolframAPICall(session, api)
488488

489-
Alternativelly, it is possible to create a :class:`~wolframclient.evaluation.WolframAPICall` directly from a session::
489+
Alternatively, it is possible to create a :class:`~wolframclient.evaluation.WolframAPICall` directly from a session::
490490

491491
>>> api_call = session.wolfram_api_call(api)
492492

@@ -554,7 +554,7 @@ The :wl:`WXF` format is also supported. It is a binary format, thus not always h
554554
>>> export(wl.Select(wl.PrimeQ, [1,2,3]), target_format='wxf')
555555
b'8:f\x02s\x06Selects\x06PrimeQf\x03s\x04ListC\x01C\x02C\x03'
556556

557-
If the `sream` parameter is set to a string path, the serialized output is directly written to the file.
557+
If the `stream` parameter is set to a string path, the serialized output is directly written to the file.
558558

559559
First, represent a Wolfram Language :wl:`ListPlot` of the first 25 :wl:`Prime` numbers::
560560

run.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
if __name__ == '__main__':
66

77
#this will perform an auto install of missing modules using PIP
8-
#this won't be used in production, but it's handy when we are ginving this paclet to other developers
8+
#this should not be used in production, but it's handy when we are giving this paclet to other developers
9+
#as it provides convenient access to unit tests, profiler, and benchmarking.
910

1011
from wolframclient.cli.dispatch import execute_from_command_line
1112

wolframclient/evaluation/cloud/asyncoauth.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ async def authenticate(self):
201201

202202

203203
class _AsyncBytesIO(object):
204-
def __init__(self, initalbytes=None):
205-
if initalbytes:
206-
self.buffer = six.BytesIO(initalbytes)
204+
def __init__(self, initial_bytes=None):
205+
if initial_bytes:
206+
self.buffer = six.BytesIO(initial_bytes)
207207
else:
208208
self.buffer = six.BytesIO()
209209

wolframclient/evaluation/cloud/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def signed_request(self, uri, headers={}, data=None, method='POST'):
7070
raise NotImplementedError
7171

7272
def authorized(self):
73-
"""Return a reasonnably accurate state of the authentication status."""
73+
"""Return a reasonably accurate state of the authentication status."""
7474
return self._client is not None and bool(
7575
self._client.client_secret) and bool(
7676
self._client.resource_owner_key) and bool(

wolframclient/evaluation/cloud/server.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
class WolframServer(object):
1111
''' Represents the cloud server.
1212
13-
Contains the authentication endpoints informations, the API endpoint aka. the
13+
Contains the authentication endpoints information, the API endpoint aka. the
1414
cloud base (`$CloudBase` in the Wolfram Language), and eventually the xauth
1515
consumer key and secret.
16-
17-
For conveniency this class exposes static methods to build instances from
18-
a `Configuration` or from a file path.
1916
'''
2017

2118
def __init__(self,

wolframclient/evaluation/kernel/kernelsession.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def _stop(self, gracefully=True):
284284
% self.get_parameter('TERMINATE_READ_TIMEOUT'))
285285
error = True
286286
# Kill process if not already terminated.
287-
# Wait for it to cleanly stop if the Quit command was succesfully sent,
287+
# Wait for it to cleanly stop if the Quit command was successfully sent,
288288
# otherwise the kernel is likely in a bad state so we kill it immediately.
289289
if self._stdin == PIPE:
290290
try:

wolframclient/evaluation/pool.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ async def _async_start_kernel(self, kernel):
173173
e2)
174174

175175
if kernel_started:
176-
# shedule the infinite evaluation loop
176+
# schedule the infinite evaluation loop
177177
task = asyncio.create_task(self._kernel_loop(kernel))
178178
if logger.isEnabledFor(logging.INFO):
179179
logger.info('New kernel started in pool: %s.', kernel)
@@ -210,8 +210,6 @@ async def start(self):
210210

211211
async def stop(self):
212212
self.stopped = True
213-
# todo cancel with self.event_abort.set() ???
214-
215213
# make sure all init tasks are finished.
216214
if len(self._pending_init_tasks) > 0:
217215
for task in self._pending_init_tasks:
@@ -275,7 +273,7 @@ async def _evaluate_all(self, iterable):
275273
return await asyncio.gather(*tasks)
276274

277275
def __repr__(self):
278-
return 'WolframEvaluatorPool<%i/%i started evaluators, cummulating %i evaluations>' % (
276+
return 'WolframEvaluatorPool<%i/%i started evaluators, cumulating %i evaluations>' % (
279277
len(self._started_tasks), self.requestedsize, self.eval_count)
280278

281279
def __len__(self):

wolframclient/evaluation/result.py

+6-19
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class WolframKernelEvaluationResult(WolframResultBase):
6767
6868
The final Python expression is lazily computed when accessing the
6969
field `result`. The WXF bytes holding the evaluation result are
70-
stored in `wxf` and thus can be parsed with a consumized parser if
70+
stored in `wxf` and thus can be parsed with a customized parser if
7171
necessary.
7272
"""
7373

@@ -101,8 +101,8 @@ class WolframEvaluationJSONResponse(WolframResultBase):
101101
"""Result object associated with cloud kernel evaluation.
102102
103103
The response body associated to this type of result must be json encoded.
104-
Other fields provide additionnal information. The HTTP response object is
105-
stored as `http_response` and when HTTP error occured it is stored in `request_error`.
104+
Other fields provide additional information. The HTTP response object is
105+
stored as `http_response` and when HTTP error occurred it is stored in `request_error`.
106106
"""
107107

108108
def __init__(self, response):
@@ -191,8 +191,8 @@ class WolframEvaluationJSONResponseAsync(WolframEvaluationJSONResponse):
191191
"""Result object associated with cloud kernel evaluation.
192192
193193
The response body associated to this type of result must be json encoded.
194-
Other fields provide additionnal information. The HTTP response object is
195-
stored as `http_response` and when HTTP error occured it is stored in `request_error`.
194+
Other fields provide additional information. The HTTP response object is
195+
stored as `http_response` and when HTTP error occurred it is stored in `request_error`.
196196
"""
197197

198198
async def _build(self):
@@ -248,7 +248,7 @@ def __repr__(self):
248248
return '{}<request error {}>'.format(self.__class__.__name__,
249249
self.http_response.status())
250250
else:
251-
return '{}<sucessful request, body not read>'.format(
251+
return '{}<successful request, body not read>'.format(
252252
self.__class__.__name__)
253253

254254

@@ -315,19 +315,6 @@ async def get(self):
315315
async def _build(self):
316316
raise NotImplementedError
317317

318-
# async generators do not exist in 3.5
319-
# async def iter_error(self):
320-
# """Generator of tuples made from the field name and the associated error message"""
321-
# if not self._built:
322-
# await self._build()
323-
# for err in self._iter_error():
324-
# yield err
325-
# async def iter_full_error_report(self):
326-
# """Generator of tuples made from the field name and the associated entire error report."""
327-
# if not self._built:
328-
# await self._build()
329-
# for err in self._iter_full_error_report():
330-
# yield err
331318
async def iter_error(self):
332319
raise NotImplementedError
333320

wolframclient/language/decorators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def safe_wl_execute(function,
2525
except Exception as e:
2626

2727
#the user might provide an exception class, that might be broken.
28-
#in this case we are running another try / except to return errors that are happneing during class serialization
28+
#in this case we are running another try / except to return errors that are happening during class serialization
2929

3030
if isinstance(e, WolframLanguageException):
3131
try:

wolframclient/language/expression.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def __repr__(self):
9999
class WLSymbolFactory(WLSymbol):
100100
"""Provide a convenient way to build objects representing arbitrary Wolfram Language expressions through the use of attributes.
101101
102-
This class is conveniently instanciated at startup as: :class:`~wolframclient.language.wl`, :class:`~wolframclient.language.Global`
103-
and :class:`~wolframclient.language.System`. It should be instanciated only to represent many symbols belonging to the same specific
102+
This class is conveniently instantiated at startup as: :class:`~wolframclient.language.wl`, :class:`~wolframclient.language.Global`
103+
and :class:`~wolframclient.language.System`. It should be instantiated only to represent many symbols belonging to the same specific
104104
context.
105105
106106
Example::

wolframclient/serializers/encoders/pil.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
the image is converted to its format, if specified, or ultimatelly to PNG. This may fail,
2222
in which case an exception is raised and there is nothing more we can do.
2323
24-
In theory we could represent any image, but due to :func:`~PIL.Image.convert()` behaviour
24+
In theory we could represent any image, but due to :func:`~PIL.Image.convert()` behavior
2525
we can't. This function is not converting, but naively casts to a given type without rescaling.
2626
e.g. int32 values above 255 converted to bytes become 255. We can't cast properly from 'I' mode
2727
since some format are using 'I' for say 'I;16' (int16) and the rawmode is not always accessible.

wolframclient/serializers/serializable.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def to_wl(self):
3636
def to_wl(self):
3737
""" Return the serialized form of a given python class.
3838
39-
The returned value must be a combinasion of serializable types.
39+
The returned value must be a combination of serializable types.
4040
"""
4141
raise NotImplementedError(
4242
'class %s must implement a to_wl method' % self.__class__.__name__)

wolframclient/serializers/wxfencoder/streaming.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def read(self, size=-1):
6262
class ZipCompressedReader(object):
6363
"""A buffer implementation reading zip compressed data from a source buffer and returning uncompressed data.
6464
65-
This class is instanciated from a reader, any object implementing a :meth:`~io.BufferedIOBase.read` method.
65+
This class is instantiated from a reader, any object implementing a :meth:`~io.BufferedIOBase.read` method.
6666
"""
6767
CHUNK_SIZE = 8192
6868

wolframclient/serializers/wxfencoder/wxfexpr.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def _serialize_to_wxf(self, stream, context):
5252

5353

5454
class WXFExprInteger(WXFExpr):
55-
''' Integers have various length, from one byte up to eigth and are signed
55+
''' Integers have various length, from one byte up to eight and are signed
5656
values. Values above 2^63-1 are represented with `WXFExprBigInteger`.
5757
Internally WXF uses the two's complement representation of integer values.
58-
The endianness is system independant and is always little-endian.
58+
The endianness is system independent and is always little-endian.
5959
'''
6060
__slots__ = 'value', 'int_size'
6161

@@ -256,7 +256,7 @@ class WXFExprAssociation(WXFExpr):
256256
def __init__(self, length):
257257
if not isinstance(length, six.integer_types) or length < 0:
258258
raise TypeError(
259-
'WXFExprAssociation must be instanciated with a length.')
259+
'WXFExprAssociation must be instantiated with a length.')
260260
super(WXFExprAssociation, self).__init__(WXF_CONSTANTS.Association)
261261
self.length = length
262262

wolframclient/serializers/wxfencoder/wxfexprprovider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WXFExprProvider(object):
1111
Expression provider pull instances of WXFExpr from instances of `WXFEncoder`.
1212
1313
`WXFExprProvider` can be initialized with an encoder. If none is provided the
14-
default class `DefaultWXFEncoder` is used to instanciate one. It is possible
14+
default class `DefaultWXFEncoder` is used to instantiate one. It is possible
1515
to add extra encoder using `add_encoder`. The order in which encoders are called
1616
is the one in which they were added. Note that for performance reasons, it is
1717
recommended to have the default encoder be first, as such one should not initialize

wolframclient/utils/dispatch.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Dispatch(object):
1414
""" A method dispatcher class allowing for multiple implementations of a function. Each implementation is associated to a specific input type.
1515
16-
Imprementations are registered with the annotation :meth:`~wolframclient.utils.dispatch.Dispatch.dispatch`.
16+
Implementations are registered with the annotation :meth:`~wolframclient.utils.dispatch.Dispatch.dispatch`.
1717
1818
The Dispatch class is callable, it behaves as a function that uses the implementation corresponding to the input parameter.
1919
@@ -47,7 +47,7 @@ def my_default_func(...)
4747
@dispatcher.dispatch((bytes, bytearray))
4848
def my_func(...)
4949
50-
Implementation must be unique. Registering the same combinaison of types will raise an error,
50+
Implementation must be unique. Registering the same combination of types will raise an error,
5151
except if `force` is set to :data:`True`, in which case the mapping is updated.
5252
"""
5353

0 commit comments

Comments
 (0)