Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit17e4f8b

Browse files
authored
Removes dependency to pyquickhelper (#34)
* remove pyquickhelper* doc* fix documentation* bypass warnings* doc
1 parentaf6fcfa commit17e4f8b

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

‎_doc/conf.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
# The following is used by sphinx.ext.linkcode to provide links to github
5656
linkcode_resolve=make_linkcode_resolve(
57-
"mlstatpy",
57+
"onnx-array-api",
5858
(
5959
"https://github.com/sdpython/onnx-array-api/"
6060
"blob/{revision}/{package}/"
@@ -114,6 +114,7 @@
114114
"https://data-apis.org/array-api/",
115115
("2022.12/API_specification/generated/array_api.{0}.html",1),
116116
),
117+
"cProfile.Profile":"https://docs.python.org/3/library/profile.html#profile.Profile",
117118
"DOT":"https://graphviz.org/doc/info/lang.html",
118119
"JIT":"https://en.wikipedia.org/wiki/Just-in-time_compilation",
119120
"onnx":"https://onnx.ai/onnx/",

‎_doc/examples/plot_benchmark_rf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
fromonnxmltools.convert.xgboost.operator_converters.XGBoostimportconvert_xgboost
2626
fromonnxruntimeimportInferenceSession,SessionOptions
2727
frompsutilimportcpu_count
28-
frompyquickhelper.loghelperimportrun_cmd
28+
fromsphinx_runpython.runpythonimportrun_cmd
2929
fromskl2onnximportto_onnx,update_registered_converter
3030
fromskl2onnx.common.shape_calculatorimportcalculate_linear_regressor_output_shapes
3131
fromsklearnimportset_config

‎_doc/examples/plot_onnxruntime.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def myloss(x, y):
4545
###############################
4646
# Profiling
4747
# +++++++++
48-
frompyquickhelper.pycode.profilingimportprofile,profile2graph
48+
fromonnx_array_api.profilingimportprofile,profile2graph
4949

5050
x=np.random.randn(10000,2).astype(np.float32)
5151
y=np.random.randn(10000,2).astype(np.float32)

‎onnx_array_api/profiling.py‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def profile2df(
491491
::
492492
493493
import pstats
494-
frompyquickhelper.pycode.profiling import profile2df
494+
fromonnx_array_api.profiling import profile2df
495495
496496
ps = pstats.Stats('bench_ortmodule_nn_gpu6.prof')
497497
df = profile2df(pd)
@@ -519,7 +519,7 @@ def profile(
519519
sort:str="cumulative",
520520
rootrem:Optional[str]=None,
521521
as_df:bool=False,
522-
return_results=False,
522+
return_results:bool=False,
523523
**kwargs,
524524
)->str:
525525
"""
@@ -532,17 +532,22 @@ def profile(
532532
:param as_df: return the results as a dataframe and not text
533533
:param return_results: if True, return results as well
534534
(in the first position)
535-
:param kwargs: additional parameters used to create the profiler
535+
:param kwargs: additional parameters used to create the profiler,
536+
see :epkg:`cProfile.Profile`
536537
:return: raw results, statistics text dump (or dataframe is *as_df* is True)
537538
538539
.. plot::
539540
540541
import matplotlib.pyplot as plt
541-
from pyquickhelper.pycode.profiling import profile
542-
from pyquickhelper.texthelper import compare_module_version
542+
from onnx_array_api.profiling import profile
543+
544+
def subf(x):
545+
return sum(x)
543546
544547
def fctm():
545-
return compare_module_version('0.20.4', '0.22.dev0')
548+
x1 = subf([1, 2, 3])
549+
x2 = subf([1, 2, 3, 4])
550+
return x1 + x2
546551
547552
pr, df = profile(lambda: [fctm() for i in range(0, 1000)], as_df=True)
548553
ax = df[['namefct', 'cum_tall']].head(n=15).set_index(
@@ -585,8 +590,7 @@ def clean_text(res):
585590
res=res.replace(sub[0],sub[1])
586591
else:
587592
raiseTypeError(
588-
"rootrem must contains strings or tuple not {0}"
589-
".".format(rootrem)
593+
f"rootrem must contains strings or tuple not{rootrem!r}."
590594
)
591595
returnres
592596

‎requirements-dev.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ openpyxl
1515
packaging
1616
pandas
1717
psutil
18-
pyquickhelper
1918
pytest
2019
pytest-cov
2120
rstcheck[sphinx,toml]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp