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

style[cartesian]: fixing typos #1815

Merged
merged 1 commit into from
Jan 22, 2025
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
4 changes: 1 addition & 3 deletions src/gt4py/cartesian/backend/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def parameter_names(self) -> Set[str]:
def make_args_data_from_gtir(pipeline: GtirPipeline) -> ModuleData:
"""
Compute module data containing information about stencil arguments from gtir.

This is no longer compatible with the legacy backends.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FlorianDeconinck: I asked @twicki yesterday and he said there were old/legacy backends back then, in a land before time. In current times, I think this comment is more confusing then helping.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well even if it was true "Legacy backends" is not a very useful description. Hell, the coffee I drunk yesterday could be consider legacy.

"""
if pipeline.stencil_id in _args_data_cache:
return _args_data_cache[pipeline.stencil_id]
Expand Down Expand Up @@ -142,7 +140,7 @@ def __call__(
"""
Generate source code for a Python module containing a StencilObject.

A possible reaosn for extending is processing additional kwargs,
A possible reason for extending is processing additional kwargs,
using a different template might require completely overriding.
"""
if builder:
Expand Down
2 changes: 1 addition & 1 deletion src/gt4py/cartesian/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def generate_cache_info(self) -> Dict[str, Any]:
"""
Generate the cache info dict.

Backend specific additions can be added via a hook propery on the backend instance.
Backend specific additions can be added via a hook properly on the backend instance.
Override :py:meth:`gt4py.backend.base.Backend.extra_cache_info` to store extra
info.
"""
Expand Down
1 change: 0 additions & 1 deletion src/gt4py/cartesian/frontend/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
parameters: List[VarDecl],
computations: List[ComputationBlock],
[externals: Dict[str, Any], sources: Dict[str, str]])

"""

from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion src/gt4py/cartesian/gtc/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AssignmentKind(eve.StrEnum):

@enum.unique
class UnaryOperator(eve.StrEnum):
"""Unary operator indentifier."""
"""Unary operator identifier."""

POS = "+"
NEG = "-"
Expand Down
2 changes: 1 addition & 1 deletion src/gt4py/cartesian/gtc/cuir/cuir_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def ctype(symbol: str) -> str:
@classmethod
def apply(cls, root: LeafNode, **kwargs: Any) -> str:
if not isinstance(root, cuir.Program):
raise ValueError("apply() requires gtcpp.Progam root node")
raise ValueError("apply() requires gtcpp.Program root node")
generated_code = super().apply(root, **kwargs)
if kwargs.get("format_source", True):
generated_code = codegen.format_source("cpp", generated_code, style="LLVM")
Expand Down
1 change: 0 additions & 1 deletion src/gt4py/cartesian/gtc/dace/expansion/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def _fix_context(
* change connector names to match inner array name (before expansion prefixed to satisfy uniqueness)
* change in- and out-edges' subsets so that they have the same shape as the corresponding array inside
* determine the domain size based on edges to StencilComputation

"""
# change connector names
for in_edge in parent_state.in_edges(node):
Expand Down
4 changes: 2 additions & 2 deletions src/gt4py/cartesian/gtc/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __add__(self, other):
return self._apply(self._broadcast(other), operator.add)

def __sub__(self, other):
"""Element-wise substraction."""
"""Element-wise subtraction."""
return self._apply(self._broadcast(other), operator.sub)

def __mul__(self, other):
Expand Down Expand Up @@ -335,7 +335,7 @@ def __add__(self, other):
return self._apply(self._broadcast(other), lambda a, b: a + b)

def __sub__(self, other):
"""Element-wise substraction."""
"""Element-wise subtraction."""
return self._apply(self._broadcast(other), lambda a, b: a - b)

def __and__(self, other):
Expand Down
1 change: 0 additions & 1 deletion src/gt4py/cartesian/gtc/gtir_to_oir.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def validate_stencil_memory_accesses(node: oir.Stencil) -> oir.Stencil:
at the OIR level. This is similar to the check at the gtir level for read-with-offset
and writes, but more complete because it involves extent analysis, so it catches
indirect read-with-offset through temporaries.

"""

def _writes(node: oir.Stencil) -> Set[str]:
Expand Down
3 changes: 1 addition & 2 deletions src/gt4py/cartesian/gtc/passes/oir_optimizations/caches.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
Note that filling and flushing k-caches can always be replaced by a local
(non-filling or flushing) k-cache plus additional filling and flushing
statements.

"""


Expand Down Expand Up @@ -261,7 +260,7 @@ class FillFlushToLocalKCaches(eve.NodeTranslator, eve.VisitorWithSymbolTableTrai
For each cached field, the following actions are performed:
1. A new locally-k-cached temporary is introduced.
2. All accesses to the original field are replaced by accesses to this temporary.
3. Loop sections are split where necessary to allow single-level loads whereever possible.
3. Loop sections are split where necessary to allow single-level loads wherever possible.
3. Fill statements from the original field to the temporary are introduced.
4. Flush statements from the temporary to the original field are introduced.
"""
Expand Down
3 changes: 1 addition & 2 deletions src/gt4py/cartesian/gtscript_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
gtscript_imports.enable(
search_path=[<path1>, <path2>, ...], # for allowing only in search_path
generate_path=<mybuildpath>, # for generating python modules in a specific dir
in_source=False, # set True to generate python modules next to gtscfipt files
in_source=False, # set True to generate python modules next to gtscript files
)

# scoped usage
with gtscript_imports.enabled():
import ...

"""

import importlib
Expand Down
2 changes: 1 addition & 1 deletion src/gt4py/cartesian/testing/suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def _run_test_implementation(cls, parameters_dict, implementation): # too compl
# call implementation
implementation(**test_values, origin=origin, domain=domain, exec_info=exec_info)

# for validation data, data is cropped to actually touched domain, so that origin offseting
# for validation data, data is cropped to actually touched domain, so that origin offsetting
# does not have to be implemented for every test suite. This is done based on info
# specified in test suite
cropped_validation_values = {}
Expand Down
1 change: 0 additions & 1 deletion src/gt4py/eve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
7. visitors
8. traits
9. codegen

"""

from __future__ import annotations
Expand Down
1 change: 0 additions & 1 deletion src/gt4py/eve/datamodels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
>>> CustomModel(3, 2)
Instance 1 == 1.5
CustomModel(value=1.5)

"""

from . import core as core, validators as validators # imported but unused
Expand Down
Loading