8000 Fix bugs and add method comparison recipes · data-apis/array-api-comparison@79f5a3c · GitHub
[go: up one dir, main page]

Skip to content

Commit 79f5a3c

Browse files
committed
Fix bugs and add method comparison recipes
1 parent 8932102 commit 79f5a3c

7 files changed

+477
-13
lines changed

tools/make/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,9 @@ include $(TOOLS_MAKE_LIB_DIR)/join.mk
8787
include $(TOOLS_MAKE_LIB_DIR)/lib_top_k_common.mk
8888
include $(TOOLS_MAKE_LIB_DIR)/lib_top_k_common_complement.mk
8989
include $(TOOLS_MAKE_LIB_DIR)/lib_top_k_complement.mk
90+
include $(TOOLS_MAKE_LIB_DIR)/method_common_apis.mk
91+
include $(TOOLS_MAKE_LIB_DIR)/method_common_complement.mk
92+
include $(TOOLS_MAKE_LIB_DIR)/method_complement.mk
93+
include $(TOOLS_MAKE_LIB_DIR)/method_intersection.mk
9094
include $(TOOLS_MAKE_LIB_DIR)/method_join.mk
9195
include $(TOOLS_MAKE_LIB_DIR)/node.mk

tools/make/lib/common_apis_ranks.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ clean-common-apis-ranks-data:
110110
# make clean-common-apis-ranks-docs
111111
#/
112112
clean-common-apis-ranks-docs:
113-
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(LIB_TOP_K_COMMON_HTML_OUT)
113+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COMMON_APIS_RANKS_HTML_OUT)
114114

115115
.PHONY: clean-common-apis-ranks-docs

tools/make/lib/common_complement.mk

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,42 +74,42 @@ common-complement: $(COMMON_COMPLEMENT_JSON_OUT) $(COMMON_COMPLEMENT_CSV_OUT) $(
7474
# Opens an HTML table in a web browser.
7575
#
7676
# @example
77-
# make view-comment-complement
77+
# make view-common-complement
7878
#/
79-
view-comment-complement: $(COMMON_COMPLEMENT_HTML_OUT)
79+
view-common-complement: $(COMMON_COMPLEMENT_HTML_OUT)
8080
$(QUIET) $(OPEN) $(COMMON_COMPLEMENT_HTML_OUT)
8181

82-
.PHONY: view-comment-complement
82+
.PHONY: view-common-complement
8383

8484
#/
8585
# Removes build artifacts.
8686
#
8787
# @example
88-
# make clean-comment-complement
88+
# make clean-common-complement
8989
#/
90-
clean-comment-complement: clean-comment-complement-data clean-comment-complement-docs
90+
clean-common-complement: clean-common-complement-data clean-common-complement-docs
9191

92-
.PHONY: clean-comment-complement
92+
.PHONY: clean-common-complement
9393

9494
#/
9595
# Removes generated datasets.
9696
#
9797
# @example
98-
# make clean-comment-complement-data
98+
# make clean-common-complement-data
9999
#/
100-
clean-comment-complement-data:
100+
clean-common-complement-data:
101101
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COMMON_COMPLEMENT_JSON_OUT)
102102
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COMMON_COMPLEMENT_CSV_OUT)
103103

104-
.PHONY: clean-comment-complement-data
104+
.PHONY: clean-common-complement-data
105105

106106
#/
107107
# Removes generated documentation.
108108
#
109109
# @example
110-
# make clean-comment-complement-docs
110+
# make clean-common-complement-docs
111111
#/
112-
clean-comment-complement-docs:
112+
clean-common-complement-docs:
113113
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(COMMON_COMPLEMENT_HTML_OUT)
114114

115-
.PHONY: clean-comment-complement-docs
115+
.PHONY: clean-common-complement-docs

tools/make/lib/method_common_apis.mk

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#/
2+
# @license MIT
3+
#
4+
# Copyright (c) 2020 Python Data APIs Consortium.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
#/
24+
25+
# VARIABLES #
26+
27+
# Define the output file path for common API data as JSON:
28+
METHOD_COMMON_APIS_JSON_OUT ?= $(DATA_DIR)/method_common_apis.json
29+
30+
# Define the output file path for common API data as CSV:
31+
METHOD_COMMON_APIS_CSV_OUT ?= $(DATA_DIR)/method_common_apis.csv
32+
33+
# Define the output file path for viewing common API data as an HTML table:
34+
METHOD_COMMON_APIS_HTML_OUT ?= $(DOCS_DIR)/method_common_apis.html
35+
36+
37+
# RULES #
38+
39+
#/
40+
# Generates a JSON file containing common APIs (as determined by a threshold).
41+
#
42+
# @private
43+
#/
44+
$(METHOD_COMMON_APIS_JSON_OUT): $(METHOD_JOIN_JSON_OUT)
45+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/method_common_apis_json.js > $(METHOD_COMMON_APIS_JSON_OUT)
46+
47+
#/
48+
# Generates a CSV file containing common APIs (as determined by a threshold).
49+
#
50+
# @private
51+
#/
52+
$(METHOD_COMMON_APIS_CSV_OUT): $(METHOD_COMMON_APIS_JSON_OUT)
53+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/json2csv.js $(METHOD_COMMON_APIS_JSON_OUT) > $(METHOD_COMMON_APIS_CSV_OUT)
54+
55+
#/
56+
# Generates HTML assets for viewing common API data.
57+
#
58+
# @private
59+
#/
60+
$(METHOD_COMMON_APIS_HTML_OUT): $(METHOD_COMMON_APIS_JSON_OUT)
61+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/html_table.js $(METHOD_COMMON_APIS_JSON_OUT) --title="Common Methods" > $(METHOD_COMMON_APIS_HTML_OUT)
62+
63+
#/
64+
# Generates data assets.
65+
#
66+
# @example
67+
# make method-common-apis
68+
#/
69+
method-common-apis: $(METHOD_COMMON_APIS_JSON_OUT) $(METHOD_COMMON_APIS_CSV_OUT) $(METHOD_COMMON_APIS_HTML_OUT)
70+
71+
.PHONY: method-common-apis
72+
73+
#/
74+
# Opens an HTML table in a web browser.
75+
#
76+
# @example
77+
# make view-method-common-apis
78+
#/
79+
view-method-common-apis: $(METHOD_COMMON_APIS_HTML_OUT)
80+
$(QUIET) $(OPEN) $(METHOD_COMMON_APIS_HTML_OUT)
81+
82+
.PHONY: view-method-common-apis
83+
84+
#/
85+
# Removes build artifacts.
86+
#
87+
# @example
88+
# make clean-method-common-apis
89+
#/
90+
clean-method-common-apis: clean-method-common-apis-data clean-method-common-apis-docs
91+
92+
.PHONY: clean-method-common-apis
93+
94+
#/
95+
# Removes generated datasets.
96+
#
97+
# @example
98+
# make clean-method-common-apis-data
99+
#/
100+
clean-method-common-apis-data:
101+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_APIS_JSON_OUT)
102+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_APIS_CSV_OUT)
103+
104+
.PHONY: clean-method-common-apis-data
105+
106+
#/
107+
# Removes generated documentation.
108+
#
109+
# @example
110+
# make clean-method-common-apis-docs
111+
#/
112+
clean-method-common-apis-docs:
113+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_APIS_HTML_OUT)
114+
115+
.PHONY: clean-method-common-apis-docs
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#/
2+
# @license MIT
3+
#
4+
# Copyright (c) 2020 Python Data APIs Consortium.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
#/
24+
25+
# VARIABLES #
26+
27+
# Define the output file path for common API complement data as JSON:
28+
METHOD_COMMON_COMPLEMENT_JSON_OUT ?= $(DATA_DIR)/method_common_complement.json
29+
30+
# Define the output file path for common API complement data as CSV:
31+
METHOD_COMMON_COMPLEMENT_CSV_OUT ?= $(DATA_DIR)/method_common_complement.csv
32+
33+
# Define the output file path for viewing common API complement data as an HTML table:
34+
METHOD_COMMON_COMPLEMENT_HTML_OUT ?= $(DOCS_DIR)/method_common_complement.html
35+
36+
37+
# RULES #
38+
39+
#/
40+
# Generates a JSON file containing the complement of common APIs.
41+
#
42+
# @private
43+
#/
44+
$(METHOD_COMMON_COMPLEMENT_JSON_OUT): $(METHOD_JOIN_JSON_OUT) $(METHOD_COMMON_APIS_JSON_OUT)
45+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/method_common_complement_json.js > $(METHOD_COMMON_COMPLEMENT_JSON_OUT)
46+
47+
#/
48+
# Generates a CSV file containing the complement of common APIs.
49+
#
50+
# @private
51+
#/
52+
$(METHOD_COMMON_COMPLEMENT_CSV_OUT): $(METHOD_COMMON_COMPLEMENT_JSON_OUT)
53+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/json2csv.js $(METHOD_COMMON_COMPLEMENT_JSON_OUT) > $(METHOD_COMMON_COMPLEMENT_CSV_OUT)
54+
55+
#/
56+
# Generates HTML assets for viewing complement data.
57+
#
58+
# @private
59+
#/
60+
$(METHOD_COMMON_COMPLEMENT_HTML_OUT): $(METHOD_COMMON_COMPLEMENT_JSON_OUT)
61+
$(QUIET) $(NODE) $(SCRIPTS_DIR)/html_table.js $(METHOD_COMMON_COMPLEMENT_JSON_OUT) --title="Non-Universal Methods (common)" > $(METHOD_COMMON_COMPLEMENT_HTML_OUT)
62+
63+
#/
64+
# Generates data assets.
65+
#
66+
# @example
67+
# make method-common-complement
68+
#/
69+
method-common-complement: $(METHOD_COMMON_COMPLEMENT_JSON_OUT) $(METHOD_COMMON_COMPLEMENT_CSV_OUT) $(METHOD_COMMON_COMPLEMENT_HTML_OUT)
70+
71+
.PHONY: method-common-complement
72+
73+
#/
74+
# Opens an HTML table in a web browser.
75+
#
76+
# @example
77+
# make view-method-common-complement
78+
#/
79+
view-method-common-complement: $(METHOD_COMMON_COMPLEMENT_HTML_OUT)
80+
$(QUIET) $(OPEN) $(METHOD_COMMON_COMPLEMENT_HTML_OUT)
81+
82+
.PHONY: view-method-common-complement
83+
84+
#/
85+
# Removes build artifacts.
86+
#
87+
# @example
88+
# make clean-method-common-complement
89+
#/
90+
clean-method-common-complement: clean-method-common-complement-data clean-method-common-complement-docs
91+
92+
.PHONY: clean-method-common-complement
93+
94+
#/
95+
# Removes generated datasets.
96+
#
97+
# @example
98+
# make clean-method-common-complement-data
99+
#/
100+
clean-method-common-complement-data:
101+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_COMPLEMENT_JSON_OUT)
102+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_COMPLEMENT_CSV_OUT)
103+
104+
.PHONY: clean-method-common-complement-data
105+
106+
#/
107+
# Removes generated documentation.
108+
#
109+
# @example
110+
# make clean-method-common-complement-docs
111+
#/
112+
clean-method-common-complement-docs:
113+
$(QUIET) $(DELETE) $(DELETE_FLAGS) $(METHOD_COMMON_COMPLEMENT_HTML_OUT)
114+
115+
.PHONY: clean-method-common-complement-docs

0 commit comments

Comments
 (0)
0