Skip to content

Conversation

@justinchuby
Copy link
Collaborator

Signed-off-by: Justin Chu justinchuby@users.noreply.github.com

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 8.65052% with 264 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.84%. Comparing base (8a94ad6) to head (7f2fd2b).

Files with missing lines Patch % Lines
onnxscript/_converter.py 5.01% 246 Missing ⚠️
onnxscript/_internal/_analysis.py 38.46% 8 Missing ⚠️
onnxscript/_converter_test.py 0.00% 3 Missing ⚠️
onnxscript/_internal/_analysis_test.py 25.00% 3 Missing ⚠️
onnxscript/_internal/autocast.py 0.00% 1 Missing ⚠️
onnxscript/ir/_schemas.py 66.66% 1 Missing ⚠️
onnxscript/main.py 50.00% 1 Missing ⚠️
onnxscript/values.py 50.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (8a94ad6) and HEAD (7f2fd2b). Click for more details.

HEAD has 83 uploads less than BASE
Flag BASE (8a94ad6) HEAD (7f2fd2b)
84 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2457       +/-   ##
===========================================
- Coverage   70.46%   10.84%   -59.62%     
===========================================
  Files         224      214       -10     
  Lines       26572    25011     -1561     
  Branches     2637     2530      -107     
===========================================
- Hits        18723     2712    -16011     
- Misses       6928    22288    +15360     
+ Partials      921       11      -910     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
op_signature, args, kwargs
)
args = [self._translate_opt_expr(x) for x in args]
onnx_inputs = [self._translate_opt_expr(x) for x in inputs]

Check warning

Code scanning / lintrunner

PYLINT/W0612 Warning

Unused variable 'onnx_inputs' (unused-variable)
See unused-variable. To disable, use # pylint: disable=unused-variable
op_signature, args, kwargs
)
args = [self._translate_opt_expr(x) for x in args]
onnx_inputs = [self._translate_opt_expr(x) for x in inputs]

Check warning

Code scanning / lintrunner

RUFF/F841 Warning

Local variable onnx_inputs is assigned to but never used.
See https://docs.astral.sh/ruff/rules/unused-variable
elif kwargs.get(param.name) is not None:
attribute = kwargs[param.name] # type: ignore[assignment]
else:
if param.required:

Check notice

Code scanning / lintrunner

PYLINT/R1720 Note

Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
See no-else-raise. To disable, use # pylint: disable=no-else-raise
from __future__ import annotations

import collections.abc
import copy

Check warning

Code scanning / lintrunner

PYLINT/W0611 Warning

Unused import copy (unused-import)
See unused-import. To disable, use # pylint: disable=unused-import
from __future__ import annotations

import collections.abc
import copy

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

copy imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
top_level_ast = ast.parse(source)
f_ast = top_level_ast.body[0]
cvt = converter.Converter(
cvt = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
# TODO: cleanup Converter interface/API, separating checker from
# converter
convert = converter.Converter(
convert = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
global_names = module.__dict__.copy()
global_names.update(closure.nonlocals)
converter = converter_module.Converter(
converter = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
def analyze(self, fun):
source, parse_tree = ast_utils.get_src_and_ast(fun)
analysis.do_liveness_analysis(parse_tree, formatter(source))
_analysis.do_liveness_analysis(parse_tree, formatter(source))

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'meta' in function call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
converter_: _converter.Converter,
op_schema: Optional[OpSchema],
args: Sequence[Optional[converter.Variable]],
args: Sequence[Optional[_converter.Variable]],

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]
"""

def get_type_info(x: Optional[converter.Variable]) -> Optional[converter.Variable]:
def get_type_info(x: Optional[_converter.Variable]) -> Optional[_converter.Variable]:

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]

def cast_like(
x: Optional[converter.Variable], y: Optional[converter.Variable]
x: Optional[_converter.Variable], y: Optional[_converter.Variable]

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
tensor = autocast.pyvalue_to_onnx_tensor(ovar, pyvalue)
except ValueError as e:
tensor = ir.tensor(pyvalue, name=var_name)
except Exception as e:

Check warning

Code scanning / lintrunner

PYLINT/W0718 Warning

Catching too general exception Exception (broad-exception-caught)
See broad-exception-caught. To disable, use # pylint: disable=broad-exception-caught
preferred_name = f"return_val{suffix}"
return_var = self._translate_expr(exp, preferred_name).name
val = self._lookup(return_var, self._source_of(exp), False)
assert type(val) is values.Dynamic

Check notice

Code scanning / lintrunner

PYLINT/C0123 Note

Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
See unidiomatic-typecheck. To disable, use # pylint: disable=unidiomatic-typecheck
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
return tuple(reversed(inputs_reversed)), named_attrs


def _to_onnx_ref_attr(val: values.AttrRef, info: sourceinfo.SourceInfo | None) -> ir.Attr:

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "values.AttrRef" is not defined To disable, use # type: ignore[name-defined]

from onnxscript import converter as converter_module
from onnxscript import irbuilder, sourceinfo, type_annotation
from onnxscript import _converter, irbuilder, sourceinfo, type_annotation

Check warning

Code scanning / lintrunner

PYLINT/W0611 Warning

Unused sourceinfo imported from onnxscript (unused-import)
See unused-import. To disable, use # pylint: disable=unused-import

from onnxscript import converter as converter_module
from onnxscript import irbuilder, sourceinfo, type_annotation
from onnxscript import _converter, irbuilder, sourceinfo, type_annotation

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

onnxscript.sourceinfo imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Sequence,
Tuple,
Union,
_GenericAlias

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

typing._GenericAlias imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

PYLINT/E0602 Error

Undefined variable 'IntFlag' (undefined-variable)
See undefined-variable. To disable, use # pylint: disable=undefined-variable
"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

RUFF/F821 Error

"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "IntFlag" is not defined To disable, use # type: ignore[name-defined]
self._converter = converter

def get_or_create_value(
self, var: str, info: sourceinfo.SourceInfo

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning

Unused argument 'info' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
def is_base_type_bool(attr: ir.Attr) -> bool:
"""Check if the attribute is a boolean type."""
# FIXME: Add meta to attributes
attr.meta[_SOURCEINFO_FIELD]

Check warning

Code scanning / lintrunner

PYLINT/W0104 Warning

Statement seems to have no effect (pointless-statement)
See pointless-statement. To disable, use # pylint: disable=pointless-statement
@justinchuby justinchuby self-assigned this Oct 27, 2025
@justinchuby
Copy link
Collaborator Author

Replaced by #2665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants