Skip to content

Commit 548e751

Browse files
committed
Merge branch 'main' into release/2025.1
2 parents 0cc192e + 99e433e commit 548e751

27 files changed

+899
-491
lines changed

.github/workflows/ci-build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
python-version: ${{ env.MAIN_PYTHON_VERSION }}
5151
target: "all"
52-
whitelist-license-check: "attrs" # This has MIT license but fails the check
52+
whitelist-license-check: "attrs,referencing,jeepney" # This has MIT license but fails the check
5353

5454
docs-style:
5555
name: Documentation Style Check
@@ -130,7 +130,7 @@ jobs:
130130
operating-system: ${{ runner.os }}
131131
python-version: ${{ matrix.python-version }}
132132
target: "all"
133-
whitelist-license-check: "attrs" # This has MIT license but fails the check
133+
whitelist-license-check: "attrs,referencing,jeepney" # This has MIT license but fails the check
134134

135135
- name: List dependencies (pip freeze)
136136
run: |

.github/workflows/create-milestone.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
"ansys/pypim",
4747
"ansys/pyprimemesh",
4848
"ansys/pyrocky",
49+
"ansys/pyscadeone",
4950
"ansys/pyseascape",
5051
"ansys/pysherlock",
5152
"ansys/pysimai",

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
repos:
22

33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.9.1
4+
rev: v0.9.7
55
hooks:
66
- id: ruff
77
- id: ruff-format
88

99
- repo: https://github.com/codespell-project/codespell
10-
rev: v2.3.0
10+
rev: v2.4.1
1111
hooks:
1212
- id: codespell
1313
args: ["--ignore-words=ignore_words.txt"]
@@ -29,12 +29,12 @@ repos:
2929

3030
# this validates our github workflow files
3131
- repo: https://github.com/python-jsonschema/check-jsonschema
32-
rev: 0.31.0
32+
rev: 0.31.2
3333
hooks:
3434
- id: check-github-workflows
3535

3636
- repo: https://github.com/ansys/pre-commit-hooks
37-
rev: v0.4.4
37+
rev: v0.5.1
3838
hooks:
3939
- id: add-license-headers
4040
args:

README.rst

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ The ``pyansys`` metapackage ensures compatibility between these PyAnsys packages
7373
- `PyPIM <https://pypim.docs.pyansys.com/>`_: Pythonic interface to communicate with the Ansys PIM (Product Instance Management) API.
7474
- `PyPrimeMesh <https://prime.docs.pyansys.com/>`_: Python library to acquire geometries and prepare surface and volume meshes for multiple solvers.
7575
- `PyRocky <https://rocky.docs.pyansys.com/>`_: Python library to communicate with Ansys Rocky using Rocky PrePost API.
76+
- `PyScadeOne <https://scadeone.docs.pyansys.com/>`_: Pythonic interface for Ansys Scade One.
7677
- `PySeascape <https://seascape.docs.pyansys.com/>`_: Pythonic interface to communicate with Ansys RedHawkSC and TotemSC.
7778
- `PySherlock <https://sherlock.docs.pyansys.com/>`_: Pythonic interface to communicate with Ansys Sherlock.
7879
- `PySimAI <https://simai.docs.pyansys.com/>`_: Pythonic interface to use SimAI.

doc/source/_static/css/landing_page.css

+40-18
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,40 @@ html {
1010
}
1111
.landing-page-sidebar-section {
1212
margin-bottom: 2rem;
13-
font-weight: bold;
13+
font-weight: 700;
1414
display: flex;
1515
flex-direction: column;
16-
gap: 1rem;
16+
gap: 0.25rem;
17+
}
18+
19+
.show-more {
20+
margin-top: 1rem;
1721
}
22+
1823
.landing-page-sidebar-section span {
19-
font-size: 18px;
20-
font-weight: bold;
24+
font-size: 0.85rem;
2125
}
26+
2227
.family-row,
2328
.tag-row {
2429
display: flex;
2530
align-items: center;
2631
margin: 5px 0;
32+
font-weight: 400;
33+
padding: 0.25rem;
2734
}
35+
2836
.family-row input,
2937
.tag-row input {
30-
margin-right: 10px;
31-
}
32-
.family-name {
33-
margin-right: 10px;
38+
margin-right: 0.625rem;
39+
height: 1rem;
40+
width: 1rem;
3441
}
35-
.family-count {
42+
43+
.family-count,
44+
.tag-count {
3645
margin-left: auto;
37-
background-color: lightgrey;
46+
background-color: var(--ast-sidebar-hover-background);
3847
border-radius: 50%;
3948
padding: 0.25rem 0.75rem;
4049
}
@@ -44,14 +53,7 @@ html {
4453
flex-wrap: wrap;
4554
gap: 0.5rem;
4655
}
47-
.selected-family {
48-
display: flex;
49-
align-items: center;
50-
gap: 1rem;
51-
padding: 0.25rem 0.5rem;
52-
border-radius: 5px;
53-
background-color: lightgrey;
54-
}
56+
5557
.remove-family {
5658
cursor: pointer;
5759
color: black;
@@ -94,6 +96,16 @@ html {
9496
padding: 0.5rem;
9597
padding-left: 1rem;
9698
}
99+
.sd-bg-muted {
100+
background-color: var(--ast-sidebar-hover-background) !important;
101+
border-radius: 999px;
102+
font-size: 12px;
103+
line-height: 16px;
104+
}
105+
106+
[data-theme="dark"] .sd-bg-muted {
107+
background-color: #3d3d3d !important;
108+
}
97109

98110
@media screen and (max-width: 768px) {
99111
.projects {
@@ -109,3 +121,13 @@ html {
109121
width: 90%;
110122
}
111123
}
124+
125+
.selected-tag,
126+
.selected-family {
127+
display: inline-block;
128+
background-color: var(--ast-sidebar-hover-background);
129+
padding: 0.25rem 0.5rem;
130+
border-radius: 0.25rem;
131+
margin: 0.25em;
132+
font-weight: 600;
133+
}

doc/source/_static/js/landing_page.js

+107-43
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ function displayFamilies(familyCounts) {
5151
familiesContainer.innerHTML = "";
5252

5353
const sortedFamilies = Object.keys(familyCounts).sort();
54+
const maxVisible = 5; // Show only first 5 initially
55+
let showMoreClicked = false;
5456

55-
sortedFamilies.forEach((family) => {
57+
sortedFamilies.forEach((family, index) => {
5658
const familyCount = familyCounts[family];
5759

5860
const familyRow = document.createElement("div");
5961
familyRow.className = "family-row";
62+
if (index >= maxVisible) familyRow.style.display = "none"; // Hide extra items initially
6063

6164
const checkbox = document.createElement("input");
6265
checkbox.type = "checkbox";
@@ -67,29 +70,53 @@ function displayFamilies(familyCounts) {
6770
familyName.className = "family-name";
6871
familyName.textContent = family;
6972

70-
const familyCountElem = document.createElement("span");
71-
familyCountElem.className = "family-count";
72-
familyCountElem.textContent = `(${familyCount})`;
73+
const familyCountElement = document.createElement("span");
74+
familyCountElement.className = "family-count";
75+
familyCountElement.textContent = `${familyCount}`;
7376

7477
familyRow.appendChild(checkbox);
7578
familyRow.appendChild(familyName);
76-
//familyRow.appendChild(familyCountElem);
79+
familyRow.appendChild(familyCountElement);
7780

7881
familiesContainer.appendChild(familyRow);
7982
});
83+
84+
// Handle "Show more" click
85+
const showMoreButton = document.querySelector(".product-families .show-more");
86+
const FamilyRows = document.querySelectorAll(".family-row");
87+
showMoreButton.addEventListener("click", () => {
88+
if (showMoreClicked) {
89+
FamilyRows.forEach((row, index) => {
90+
if (index >= maxVisible) {
91+
row.style.display = "none";
92+
}
93+
});
94+
showMoreButton.textContent = "Show more";
95+
showMoreClicked = false;
96+
} else {
97+
FamilyRows.forEach((row) => {
98+
row.style.display = "flex";
99+
});
100+
showMoreButton.textContent = "Show less";
101+
showMoreClicked = true;
102+
}
103+
});
80104
}
81105

82106
function displayTags(tagCounts) {
83107
const tagsContainer = document.getElementById("product-tags-list");
84108
tagsContainer.innerHTML = "";
85109

86110
const sortedTags = Object.keys(tagCounts).sort();
111+
const maxVisible = 5; // Show only first 5 initially
112+
let showMoreClicked = false;
87113

88-
sortedTags.forEach((tag) => {
114+
sortedTags.forEach((tag, index) => {
89115
const tagCount = tagCounts[tag];
90116

91117
const tagRow = document.createElement("div");
92118
tagRow.className = "tag-row";
119+
if (index >= maxVisible) tagRow.style.display = "none"; // Hide extra items initially
93120

94121
const checkbox = document.createElement("input");
95122
checkbox.type = "checkbox";
@@ -100,19 +127,56 @@ function displayTags(tagCounts) {
100127
tagName.className = "tag-name";
101128
tagName.textContent = tag;
102129

103-
const tagCountElem = document.createElement("span");
104-
tagCountElem.className = "tag-count";
105-
tagCountElem.textContent = `(${tagCount})`;
130+
const tagCountElement = document.createElement("span");
131+
tagCountElement.className = "tag-count";
132+
tagCountElement.textContent = `${tagCount}`;
106133

107134
tagRow.appendChild(checkbox);
108135
tagRow.appendChild(tagName);
109-
//tagRow.appendChild(tagCountElem);
136+
tagRow.appendChild(tagCountElement);
110137

111138
tagsContainer.appendChild(tagRow);
112139
});
140+
141+
// Handle "Show more" click
142+
const showMoreButton = document.querySelector(".product-tags .show-more");
143+
const TagRows = document.querySelectorAll(".tag-row");
144+
showMoreButton.addEventListener("click", () => {
145+
if (showMoreClicked) {
146+
TagRows.forEach((row, index) => {
147+
if (index >= maxVisible) {
148+
row.style.display = "none";
149+
}
150+
});
151+
showMoreButton.textContent = "Show more";
152+
showMoreClicked = false;
153+
} else {
154+
TagRows.forEach((row) => {
155+
row.style.display = "flex";
156+
});
157+
showMoreButton.textContent = "Show less";
158+
showMoreClicked = true;
159+
}
160+
});
113161
}
114162

115163
function handleFamilySelection() {
164+
applyFilters();
165+
}
166+
167+
function handleTagSelection() {
168+
applyFilters();
169+
}
170+
171+
function applyFilters() {
172+
const SelectedTagsContainer = document.getElementById(
173+
"selected-product-tags-list",
174+
);
175+
const SelectedFamiliesContainer = document.getElementById(
176+
"selected-product-families-list",
177+
);
178+
SelectedTagsContainer.innerHTML = "";
179+
SelectedFamiliesContainer.innerHTML = "";
116180
const selectedFamilies = Array.from(
117181
document.querySelectorAll(
118182
'#product-families-list input[type="checkbox"]:checked',
@@ -121,58 +185,58 @@ function handleFamilySelection() {
121185
checkbox.id.replace("family-", "").replace("\\ ", "-").toLowerCase(),
122186
);
123187

124-
console.log("Selected families:", selectedFamilies);
125-
126-
const projectCards = document.querySelectorAll(".project-card");
127-
128-
projectCards.forEach((card) => {
129-
const family = card.getAttribute("data-family").toLowerCase();
130-
console.log("Family:", family);
131-
card.style.display =
132-
selectedFamilies.length === 0 || selectedFamilies.includes(family)
133-
? "flex"
134-
: "none";
135-
});
136-
}
137-
138-
function handleTagSelection() {
139188
const selectedTags = Array.from(
140189
document.querySelectorAll(
141190
'#product-tags-list input[type="checkbox"]:checked',
142191
),
143192
).map((checkbox) =>
144193
checkbox.id.replace("tag-", "").replace("\\ ", "-").toLowerCase(),
145194
);
195+
for (const tag of selectedTags) {
196+
const selectedTag = document.createElement("span");
197+
selectedTag.className = "selected-tag";
198+
selectedTag.textContent = tag;
199+
SelectedTagsContainer.appendChild(selectedTag);
200+
}
201+
202+
for (const family of selectedFamilies) {
203+
const selectedFamily = document.createElement("span");
204+
selectedFamily.className = "selected-family";
205+
selectedFamily.textContent = family;
206+
SelectedFamiliesContainer.appendChild(selectedFamily);
207+
}
146208

209+
console.log("Selected families:", selectedFamilies);
147210
console.log("Selected tags:", selectedTags);
148211

149212
const projectCards = document.querySelectorAll(".project-card");
150213

151214
projectCards.forEach((card) => {
215+
const family = card.getAttribute("data-family").toLowerCase();
152216
const rawTags = card.getAttribute("data-tags");
153217

154-
if (!rawTags) {
155-
card.style.display = "none";
156-
return;
157-
}
158-
159-
// Parse the data-tags string
160218
let cardTags = [];
161-
try {
162-
cardTags = JSON.parse(rawTags.replace(/'/g, '"'));
163-
} catch (error) {
164-
console.error("Error parsing data-tags:", rawTags, error);
165-
card.style.display = "none";
166-
return;
219+
if (rawTags) {
220+
try {
221+
cardTags = JSON.parse(rawTags.replace(/'/g, '"')).map((tag) =>
222+
tag.toLowerCase(),
223+
);
224+
} catch (error) {
225+
console.error("Error parsing data-tags:", rawTags, error);
226+
}
167227
}
168228

169-
const cardTagsLower = cardTags.map((tag) => tag.toLowerCase());
170-
const hasMatchingTag = selectedTags.some((tag) =>
171-
cardTagsLower.includes(tag),
172-
);
229+
// Check if the card matches the selected families
230+
const matchesAllFamilies =
231+
selectedFamilies.length === 0 || selectedFamilies.includes(family);
232+
233+
// Check if the card matches the selected tags
234+
const matchesAllTags =
235+
selectedTags.length === 0 ||
236+
selectedTags.every((tag) => cardTags.includes(tag));
173237

174-
card.style.display =
175-
selectedTags.length === 0 || hasMatchingTag ? "flex" : "none";
238+
// Show only if both family & tag filters match (or if no filter is applied)
239+
card.style.display = matchesAllFamilies && matchesAllTags ? "flex" : "none";
176240
});
177241
}
178242

35.1 KB
Loading
5.42 KB
Loading

0 commit comments

Comments
 (0)