Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure typos CI, fix typos #799

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ jobs:
pip install ruff
ruff check

typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

pylint:
name: Pylint
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion contrib/fortran-to-opencl/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def get_type(self, name):

if self.implicit_types is None:
raise TranslationError(
"no type for '%s' found in implict none routine"
"no type for '%s' found in implicit none routine"
% name)

return self.implicit_types.get(name[0], np.dtype(np.int32))
Expand Down
2 changes: 1 addition & 1 deletion doc/subst.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
(e.g. by being an :class:`numpy.ndarray`)
.. |explain-waitfor| replace:: *wait_for*
may either be *None* or a list of :class:`pyopencl.Event` instances for
whose completion this command waits before starting exeuction.
whose completion this command waits before starting execution.
.. |std-enqueue-blurb| replace:: Returns a new :class:`pyopencl.Event`. |explain-waitfor|

.. |copy-depr| replace:: **Note:** This function is deprecated as of PyOpenCL 2011.1.
Expand Down
8 changes: 4 additions & 4 deletions examples/n-body.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def DictionariesAPI():
Heat=MWCfp;
}

// More accurate distribution based on spherical coordonates
// More accurate distribution based on spherical coordinates
// Disactivated because of AMD Oland GPU crash on launch
// private MYFLOAT Radius,Theta,Phi,PosX,PosY,PosZ,SinTheta;
// Radius=MWCfp*diameter/2.e0f;
Expand Down Expand Up @@ -375,7 +375,7 @@ def DictionariesAPI():
}

// cast to float for sin,cos are NEEDED by Mesa FP64 implementation!
// Implemention on AMD Oland are probably broken in float
// Implementation on AMD Oland are probably broken in float

FromCoM=(MYFLOAT4)(clDataX[gid]-clCoM[0]);
Length=length(FromCoM);
Expand All @@ -387,7 +387,7 @@ def DictionariesAPI():
// Second tangential vector to sphere of length radius
ThetaB=acos((float)(FromCoM.x/Length));
PhiB=atan((float)(FromCoM.y/FromCoM.z))+5.e-1f*PI;
// (x,y) random coordonates to plane tangential to sphere
// (x,y) random coordinates to plane tangential to sphere
Polar=MWCfp*2.e0f*PI;
tA=cos((float)Polar);
tB=sin((float)Polar);
Expand Down Expand Up @@ -781,7 +781,7 @@ class MyFloat(np.float32):
Velocity = MyFloat(Velocity)
Step = MyFloat(Step)

print("Device choosed : %s" % Device)
print("Device chosen : %s" % Device)
print("Number of particules : %s" % Number)
print("Size of Shape : %s" % SizeOfShape)
print("Initial velocity : %s" % Velocity)
Expand Down
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,32 @@ skip = [
]
test-command = ""
before-all = "bash {package}/scripts/build-ocl-windows.sh"

[tool.typos.default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
]

[tool.typos.default.extend-words]
# for ND Range
ND = "ND"
nd = "nd"

# level-of-detail
LOD = "LOD"

# short for 'series'
"ser" = "ser"

# like the numpy function
"arange" = "arange"

[tool.typos.files]
extend-exclude = [
# No thanks, hex IDs in JSON should not be spellchecked.
"examples/*.ipynb",
# Copied from upstream
"pyopencl/cl/pyopencl-random123/*",
# This one has comments in French
"examples/black-hole-accretion.py"
]
12 changes: 6 additions & 6 deletions src/wrap_cl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1893,15 +1893,15 @@ namespace pyopencl
py::object m_py_event;
py::object m_py_callback;

bool m_set_callback_suceeded;
bool m_set_callback_succeeded;

bool m_notify_thread_wakeup_is_genuine;

cl_event m_event;
cl_int m_command_exec_status;

event_callback_info_t(py::object py_event, py::object py_callback)
: m_py_event(py_event), m_py_callback(py_callback), m_set_callback_suceeded(true),
: m_py_event(py_event), m_py_callback(py_callback), m_set_callback_succeeded(true),
m_notify_thread_wakeup_is_genuine(false)
{}
};
Expand Down Expand Up @@ -1945,7 +1945,7 @@ namespace pyopencl
{
py::gil_scoped_acquire acquire;

if (cb_info->m_set_callback_suceeded)
if (cb_info->m_set_callback_succeeded)
{
try {
cb_info->m_py_callback(
Expand Down Expand Up @@ -1982,7 +1982,7 @@ namespace pyopencl
// be woken up. Wake it up to let it know that it can stop.
{
std::lock_guard<std::mutex> lg(cb_info->m_mutex);
cb_info->m_set_callback_suceeded = false;
cb_info->m_set_callback_succeeded = false;
cb_info->m_notify_thread_wakeup_is_genuine = true;
}
cb_info->m_condvar.notify_one();
Expand Down Expand Up @@ -3673,7 +3673,7 @@ namespace pyopencl
#ifdef PYPY_VERSION
// FIXME: get a read-only buffer
// Not quite honest, but Pypy doesn't consider numpy arrays
// created from objects with the __aray_interface__ writeable.
// created from objects with the __array_interface__ writeable.
ward->get(holder.ptr(), PyBUF_ANY_CONTIGUOUS);
#else
ward->get(holder.ptr(), PyBUF_ANY_CONTIGUOUS | PyBUF_WRITABLE);
Expand Down Expand Up @@ -4508,7 +4508,7 @@ namespace pyopencl
py::tuple name_hdr_tup = py::borrow<py::tuple>(name_hdr_tup_py);
if (py::len(name_hdr_tup) != 2)
throw error("Program.compile", CL_INVALID_VALUE,
"epxected (name, header) tuple in headers list");
"expected (name, header) tuple in headers list");
std::string name = py::cast<std::string>(name_hdr_tup[0]);
program &prg = py::cast<program &>(name_hdr_tup[1]);

Expand Down
2 changes: 1 addition & 1 deletion test/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ def test_empty_ndrange(ctx_factory, empty_shape):
queue = cl.CommandQueue(ctx)

if ctx._get_cl_version() < (1, 2) or cl.get_cl_header_version() < (1, 2):
pytest.skip("OpenCL 1.2 required for empty NDRange suuport")
pytest.skip("OpenCL 1.2 required for empty NDRange support")

a = cl_array.zeros(queue, empty_shape, dtype=np.float32)

Expand Down
Loading