Skip to content

Commit c87a72a

Browse files
authored
Add tablemapREST Class for Table Expression Generator and Fix Issues in tablereduceREST (#360)
This PR introduces the following changes: **Added tablemapREST Class:** - Implemented the `tablemapREST` class to support the table expression generator. - Integrated the new generator into relevant sections, such as serverless, `GENERATOR_TYPES` and other constants. **Fixed Issues in tablereduceREST:** - Corrected a bug where `d["reduce_params"]` was mistakenly referenced as `d`. - Fixed an issue where `del sources[i]` was used without defining `i`. **Updated Version:** - Changed the version from `dev0` to `dev1` to ensure compatibility with teammates' ongoing changes. User Story: https://tfs.ansys.com:8443/tfs/ANSYS_Development/Portfolio/_workitems/edit/1289662
1 parent 994a7f5 commit c87a72a

File tree

7 files changed

+424
-154
lines changed

7 files changed

+424
-154
lines changed

pyproject.toml

Lines changed: 149 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,149 @@
1-
[project]
2-
name = "ansys-dynamicreporting-core"
3-
version = "0.10.2.dev0"
4-
authors = [
5-
{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"},
6-
]
7-
8-
maintainers = [
9-
{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"},
10-
{name = "Ansys ADR Team", email = "adrteam@ansys.com"},
11-
]
12-
description = "Python interface to Ansys Dynamic Reporting"
13-
readme = "README.rst"
14-
requires-python = ">=3.10"
15-
keywords = ["dynamicreporting", "pydynamicreporting", "pyansys", "ansys"]
16-
license = {text = "MIT"}
17-
classifiers = [
18-
"Development Status :: 4 - Beta",
19-
"Intended Audience :: Developers",
20-
"License :: OSI Approved :: MIT License",
21-
"Operating System :: OS Independent",
22-
"Natural Language :: English",
23-
"Programming Language :: Python :: 3.10",
24-
"Programming Language :: Python :: 3.11",
25-
"Programming Language :: Python :: 3.12",
26-
"Programming Language :: Python :: 3.13",
27-
"Topic :: Software Development :: Libraries :: Python Modules",
28-
]
29-
dependencies = [
30-
"docker>=7.1.0",
31-
"pypng>=0.20220715.0",
32-
"requests>=2.32",
33-
"urllib3<3.0.0",
34-
"Pillow>=9.3.0",
35-
"python-dateutil>=2.8.0",
36-
"pytz>=2021.3",
37-
"psutil>=6.0.0",
38-
# core ADR dependencies
39-
"django~=4.2",
40-
"djangorestframework~=3.15",
41-
"django-guardian~=2.4",
42-
"tzlocal~=5.0",
43-
"numpy>=1.23.5,<3",
44-
"python-pptx>=0.6.19,<1",
45-
"pandas>=2.0",
46-
"statsmodels>=0.14",
47-
"scipy<=1.15.3", # breaks ADR if not included. Remove when statsmodels is updated
48-
"docutils>=0.21",
49-
"psycopg[binary]>=3.2.3",
50-
"qtpy>=2.4.3"
51-
]
52-
53-
[tool.setuptools.packages.find]
54-
where = ["src"]
55-
include = ["ansys.dynamicreporting*"]
56-
57-
[project.urls]
58-
homepage = "https://github.com/ansys/pydynamicreporting"
59-
documentation = "https://dynamicreporting.docs.pyansys.com/"
60-
changelog = "https://github.com/ansys/pydynamicreporting/blob/main/CHANGELOG.rst"
61-
"Bug Tracker" = "https://github.com/ansys/pydynamicreporting/issues"
62-
repository = "https://github.com/ansys/pydynamicreporting"
63-
ci = "https://github.com/ansys/pydynamicreporting/actions"
64-
65-
[project.optional-dependencies]
66-
test = [
67-
"pytest>=8.3.3",
68-
"pytest-cov>=6.0.0",
69-
"pyvista==0.45.3",
70-
"vtk==9.4.2",
71-
"ansys-dpf-core==0.13.8",
72-
]
73-
doc = [
74-
"ansys-sphinx-theme>=1.1.1",
75-
"numpydoc>=1.8.0",
76-
"Sphinx>=8.0.2",
77-
"sphinx-copybutton>=0.5.2",
78-
"sphinx-gallery>=0.18.0",
79-
]
80-
dev = [
81-
"build",
82-
"packaging",
83-
"twine",
84-
"ipdb",
85-
"ipython",
86-
"pre-commit>=4.0.1",
87-
"black>=25.0.0",
88-
"isort>=6.0.0",
89-
]
90-
91-
[build-system]
92-
build-backend = "setuptools.build_meta"
93-
requires = [
94-
"setuptools>=75.8.0",
95-
"setuptools-scm",
96-
]
97-
98-
[tool.pytest.ini_options]
99-
tmp_path_retention_policy = "failed"
100-
testpaths = ["tests"]
101-
addopts = "--capture=tee-sys --tb=native -p no:warnings -vv"
102-
markers =[
103-
"integration:Run integration tests",
104-
"smoke:Run the smoke tests",
105-
"unit:Run the unit tests",
106-
"ado_test: subset of tests to be run in the ADO pipeline for ADR",
107-
]
108-
norecursedirs =[
109-
".git",
110-
".idea",
111-
]
112-
filterwarnings = [
113-
"ignore:.+:DeprecationWarning"
114-
]
115-
116-
[tool.coverage.run]
117-
omit = ["*/ansys/dynamicreporting/core/adr_utils.py", "*/ansys/dynamicreporting/core/build_info.py"]
118-
branch = true
119-
120-
[tool.coverage.report]
121-
show_missing = true
122-
ignore_errors = true
123-
124-
[tool.coverage.html]
125-
show_contexts = true
126-
127-
[tool.black]
128-
line-length = 100
129-
130-
[tool.isort]
131-
profile = "black"
132-
skip_gitignore = true
133-
force_sort_within_sections = true
134-
line_length = 100
135-
default_section = "THIRDPARTY"
136-
src_paths = ["doc", "src", "tests"]
137-
138-
[tool.codespell]
139-
ignore-words = "doc/styles/Vocab/ANSYS/accept.txt"
140-
skip = '*.pyc,*.xml,*.gif,*.png,*.jpg,*.js,*.html,doc/source/examples/**/*.ipynb,*.json,*.gz'
141-
quiet-level = 3
142-
143-
[tool.bandit]
144-
targets = ["src"]
145-
recursive = true
146-
number = 3
147-
severity_level = "high"
148-
require_serial = true
149-
exclude_dirs = [ "venv/*","setup.py","test_cleanup.py","tests/*","doc/*" ]
1+
[project]
2+
name = "ansys-dynamicreporting-core"
3+
version = "0.10.2.dev1"
4+
authors = [
5+
{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"},
6+
]
7+
8+
maintainers = [
9+
{name = "ANSYS, Inc.", email = "pyansys.core@ansys.com"},
10+
{name = "Ansys ADR Team", email = "adrteam@ansys.com"},
11+
]
12+
description = "Python interface to Ansys Dynamic Reporting"
13+
readme = "README.rst"
14+
requires-python = ">=3.10"
15+
keywords = ["dynamicreporting", "pydynamicreporting", "pyansys", "ansys"]
16+
license = {text = "MIT"}
17+
classifiers = [
18+
"Development Status :: 4 - Beta",
19+
"Intended Audience :: Developers",
20+
"License :: OSI Approved :: MIT License",
21+
"Operating System :: OS Independent",
22+
"Natural Language :: English",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
27+
"Topic :: Software Development :: Libraries :: Python Modules",
28+
]
29+
dependencies = [
30+
"docker>=7.1.0",
31+
"pypng>=0.20220715.0",
32+
"requests>=2.32",
33+
"urllib3<3.0.0",
34+
"Pillow>=9.3.0",
35+
"python-dateutil>=2.8.0",
36+
"pytz>=2021.3",
37+
"psutil>=6.0.0",
38+
# core ADR dependencies
39+
"django~=4.2",
40+
"djangorestframework~=3.15",
41+
"django-guardian~=2.4",
42+
"tzlocal~=5.0",
43+
"numpy>=1.23.5,<3",
44+
"python-pptx>=0.6.19,<1",
45+
"pandas>=2.0",
46+
"statsmodels>=0.14",
47+
"scipy<=1.15.3", # breaks ADR if not included. Remove when statsmodels is updated
48+
"docutils>=0.21",
49+
"psycopg[binary]>=3.2.3",
50+
"qtpy>=2.4.3"
51+
]
52+
53+
[tool.setuptools.packages.find]
54+
where = ["src"]
55+
include = ["ansys.dynamicreporting*"]
56+
57+
[project.urls]
58+
homepage = "https://github.com/ansys/pydynamicreporting"
59+
documentation = "https://dynamicreporting.docs.pyansys.com/"
60+
changelog = "https://github.com/ansys/pydynamicreporting/blob/main/CHANGELOG.rst"
61+
"Bug Tracker" = "https://github.com/ansys/pydynamicreporting/issues"
62+
repository = "https://github.com/ansys/pydynamicreporting"
63+
ci = "https://github.com/ansys/pydynamicreporting/actions"
64+
65+
[project.optional-dependencies]
66+
test = [
67+
"pytest>=8.3.3",
68+
"pytest-cov>=6.0.0",
69+
"pyvista==0.45.3",
70+
"vtk==9.4.2",
71+
"ansys-dpf-core==0.13.8",
72+
]
73+
doc = [
74+
"ansys-sphinx-theme>=1.1.1",
75+
"numpydoc>=1.8.0",
76+
"Sphinx>=8.0.2",
77+
"sphinx-copybutton>=0.5.2",
78+
"sphinx-gallery>=0.18.0",
79+
]
80+
dev = [
81+
"build",
82+
"packaging",
83+
"twine",
84+
"ipdb",
85+
"ipython",
86+
"pre-commit>=4.0.1",
87+
"black>=25.0.0",
88+
"isort>=6.0.0",
89+
]
90+
91+
[build-system]
92+
build-backend = "setuptools.build_meta"
93+
requires = [
94+
"setuptools>=75.8.0",
95+
"setuptools-scm",
96+
]
97+
98+
[tool.pytest.ini_options]
99+
tmp_path_retention_policy = "failed"
100+
testpaths = ["tests"]
101+
addopts = "--capture=tee-sys --tb=native -p no:warnings -vv"
102+
markers =[
103+
"integration:Run integration tests",
104+
"smoke:Run the smoke tests",
105+
"unit:Run the unit tests",
106+
"ado_test: subset of tests to be run in the ADO pipeline for ADR",
107+
]
108+
norecursedirs =[
109+
".git",
110+
".idea",
111+
]
112+
filterwarnings = [
113+
"ignore:.+:DeprecationWarning"
114+
]
115+
116+
[tool.coverage.run]
117+
omit = ["*/ansys/dynamicreporting/core/adr_utils.py", "*/ansys/dynamicreporting/core/build_info.py"]
118+
branch = true
119+
120+
[tool.coverage.report]
121+
show_missing = true
122+
ignore_errors = true
123+
124+
[tool.coverage.html]
125+
show_contexts = true
126+
127+
[tool.black]
128+
line-length = 100
129+
130+
[tool.isort]
131+
profile = "black"
132+
skip_gitignore = true
133+
force_sort_within_sections = true
134+
line_length = 100
135+
default_section = "THIRDPARTY"
136+
src_paths = ["doc", "src", "tests"]
137+
138+
[tool.codespell]
139+
ignore-words = "doc/styles/Vocab/ANSYS/accept.txt"
140+
skip = '*.pyc,*.xml,*.gif,*.png,*.jpg,*.js,*.html,doc/source/examples/**/*.ipynb,*.json,*.gz'
141+
quiet-level = 3
142+
143+
[tool.bandit]
144+
targets = ["src"]
145+
recursive = true
146+
number = 3
147+
severity_level = "high"
148+
require_serial = true
149+
exclude_dirs = [ "venv/*","setup.py","test_cleanup.py","tests/*","doc/*" ]

src/ansys/dynamicreporting/core/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
GENERATOR_TYPES = (
2525
"Generator:tablemerge",
2626
"Generator:tablereduce",
27+
"Generator:tablemap",
2728
"Generator:tablerowcolumnfilter",
2829
"Generator:tablevaluefilter",
2930
"Generator:tablesortfilter",

src/ansys/dynamicreporting/core/serverless/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
SQLQueryGenerator,
2525
StatisticalGenerator,
2626
TabLayout,
27+
TableMapGenerator,
2728
TableMergeGenerator,
2829
TableMergeRCFilterGenerator,
2930
TableMergeValueFilterGenerator,
@@ -70,6 +71,7 @@
7071
"TableReduceGenerator",
7172
"TableMergeRCFilterGenerator",
7273
"TableMergeValueFilterGenerator",
74+
"TableMapGenerator",
7375
"TableSortFilterGenerator",
7476
"TreeMergeGenerator",
7577
"SQLQueryGenerator",

src/ansys/dynamicreporting/core/serverless/template.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ReportType(StrEnum):
3535
# Generators
3636
TABLE_MERGE_GENERATOR = "Generator:tablemerge"
3737
TABLE_REDUCE_GENERATOR = "Generator:tablereduce"
38+
TABLE_MAP_GENERATOR = "Generator:tablemap"
3839
TABLE_ROW_COLUMN_FILTER_GENERATOR = "Generator:tablerowcolumnfilter"
3940
TABLE_VALUE_FILTER_GENERATOR = "Generator:tablevaluefilter"
4041
TABLE_SORT_FILTER_GENERATOR = "Generator:tablesortfilter"
@@ -623,6 +624,10 @@ class TableReduceGenerator(Generator):
623624
report_type: str = ReportType.TABLE_REDUCE_GENERATOR
624625

625626

627+
class TableMapGenerator(Generator):
628+
report_type: str = ReportType.TABLE_MAP_GENERATOR
629+
630+
626631
class TableMergeRCFilterGenerator(Generator):
627632
report_type: str = ReportType.TABLE_ROW_COLUMN_FILTER_GENERATOR
628633

0 commit comments

Comments
 (0)