From b54b7b17d3e4ee6d54c144db66e73f7edf482344 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 31 Jul 2025 14:56:40 +0200 Subject: [PATCH 1/4] fix: update families --- projects.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects.yaml b/projects.yaml index b6aa2a10..23438189 100644 --- a/projects.yaml +++ b/projects.yaml @@ -356,7 +356,7 @@ projects: repository: https://github.com/ansys/pyoptislang description: Pythonic interface to Ansys optiSLang thumbnail: _static/thumbnails/pyoptislang.png - family: Platform + family: Connect tags: [Flagship] icon: _static/icons/platform.svg documentation: @@ -483,7 +483,7 @@ projects: repository: https://github.com/ansys/pysystemcoupling description: Pythonic interface to Ansys System Coupling thumbnail: _static/thumbnails/pysystem-coupling.png - family: Other + family: Structures tags: [Flagship] icon: _static/icons/design.svg documentation: @@ -525,7 +525,7 @@ projects: repository: https://github.com/ansys/pyworkbench description: Pythonic interface to Ansys Workbench thumbnail: _static/thumbnails/intro.png - family: Other + family: Platform tags: [Flagship] icon: _static/icons/platform.svg documentation: From 059fa516594937cfa877700fba0c1d16f821084d Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 31 Jul 2025 15:48:37 +0200 Subject: [PATCH 2/4] feat: add multiple tags --- doc/source/_static/js/landing_page.js | 47 ++++++++++++++++++++++----- doc/source/index.rst | 19 ++++++++--- projects.yaml | 10 +++--- 3 files changed, 58 insertions(+), 18 deletions(-) diff --git a/doc/source/_static/js/landing_page.js b/doc/source/_static/js/landing_page.js index 93a70092..42d556e9 100644 --- a/doc/source/_static/js/landing_page.js +++ b/doc/source/_static/js/landing_page.js @@ -11,15 +11,24 @@ function collectFamilies(data) { for (const project of projects) { if (!project || typeof project !== "object") continue; - const family = project.family; + // Handle both single family and multiple families + let projectFamilies = []; + if (project.families && Array.isArray(project.families)) { + projectFamilies = project.families; + } else if (project.family) { + projectFamilies = [project.family]; + } + const icon = project.icon || "ansys-icon-light.svg"; // Fallback icon - if (family) { - if (!familyData[family]) { - familyData[family] = { count: 0, icon: icon }; + projectFamilies.forEach(family => { + if (family) { + if (!familyData[family]) { + familyData[family] = { count: 0, icon: icon }; + } + familyData[family].count += 1; } - familyData[family].count += 1; - } + }); } return familyData; @@ -239,9 +248,28 @@ function applyFilters() { const projectCards = document.querySelectorAll(".project-card"); projectCards.forEach((card) => { - const family = card.getAttribute("data-family").toLowerCase(); - const rawTags = card.getAttribute("data-tags"); + // Handle both single family and multiple families from data attributes + const rawFamilies = card.getAttribute("data-families") || card.getAttribute("data-family"); + let cardFamilies = []; + + if (rawFamilies) { + try { + // Try to parse as JSON array first (for multiple families) + if (rawFamilies.startsWith('[')) { + cardFamilies = JSON.parse(rawFamilies.replace(/'/g, '"')).map((family) => + family.toLowerCase(), + ); + } else { + // Single family as string + cardFamilies = [rawFamilies.toLowerCase()]; + } + } catch (error) { + // Fallback to treating as single family string + cardFamilies = [rawFamilies.toLowerCase()]; + } + } + const rawTags = card.getAttribute("data-tags"); let cardTags = []; if (rawTags) { try { @@ -255,7 +283,8 @@ function applyFilters() { // Check if the card matches the selected families const matchesAllFamilies = - selectedFamilies.length === 0 || selectedFamilies.includes(family); + selectedFamilies.length === 0 || + selectedFamilies.some(selectedFamily => cardFamilies.includes(selectedFamily)); // Check if the card matches the selected tags const matchesAllTags = diff --git a/doc/source/index.rst b/doc/source/index.rst index 65057d80..86cf729e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -22,12 +22,21 @@ it is now a collection of many Python packages for using Ansys products through
{% for project, metadata in projects['projects'].items() %} - {% set family = metadata.get('family', 'other') | lower | replace(' ', '-') %} - {% set tags = metadata.get('tags', 'other') | lower %} + {% if metadata.get('families') %} + {% set families = metadata.get('families', []) %} + {% set family_attr = families | join(',') | lower | replace(' ', '-') %} + {% set family_display = families[0] | lower | replace(' ', '-') %} + {% else %} + {% set families = [metadata.get('family', 'other')] %} + {% set family_attr = metadata.get('family', 'other') | lower | replace(' ', '-') %} + {% set family_display = metadata.get('family', 'other') | lower | replace(' ', '-') %} + {% endif %} + {% set tags = metadata.get('tags', []) %}
@@ -36,7 +45,9 @@ it is now a collection of many Python packages for using Ansys products through

{{ metadata['name'] }}

{{ metadata['description'] }}

- {{ family.capitalize() }} + {% for family in families %} + {{ family }} + {% endfor %} {% for tag in metadata['tags'] %} {{ tag }} {% endfor %} diff --git a/projects.yaml b/projects.yaml index 23438189..6fdeac25 100644 --- a/projects.yaml +++ b/projects.yaml @@ -160,7 +160,7 @@ projects: repository: https://github.com/ansys/pydynamicreporting description: Pythonic interface to Ansys Dynamic Reporting for service and control of its database and reports thumbnail: _static/thumbnails/pydynamicreporting.png - family: Platform + families: [Fluids, Electronics] tags: [Tools] icon: _static/icons/platform.svg documentation: @@ -202,7 +202,7 @@ projects: repository: https://github.com/ansys/pyensight description: Pythonic interface to EnSight, the Ansys simulation postprocessor thumbnail: _static/thumbnails/pyensight.png - family: Fluids + families: [Fluids] tags: [Flagship] icon: _static/icons/fluids.svg documentation: @@ -384,7 +384,7 @@ projects: repository: https://github.com/ansys/pyprimemesh description: Python library to acquire geometries and prepare surface and volume meshes for multiple solvers thumbnail: _static/thumbnails/pyprimemesh.png - family: Meshing + families: [Meshing, CAD] tags: [Flagship] icon: _static/icons/platform.svg documentation: @@ -440,7 +440,7 @@ projects: repository: https://github.com/ansys/pysherlock description: Pythonic interface to Ansys Sherlock thumbnail: _static/thumbnails/pysherlock.png - family: Electronics + families: [Electronics, Multiphysics, Structures] tags: [Flagship, Thermal] icon: _static/icons/structures.svg documentation: @@ -525,7 +525,7 @@ projects: repository: https://github.com/ansys/pyworkbench description: Pythonic interface to Ansys Workbench thumbnail: _static/thumbnails/intro.png - family: Platform + families: [Platform, Multiphysics] tags: [Flagship] icon: _static/icons/platform.svg documentation: From 1f0c55041fd795c6bb7ec55f96dc94161065e7b5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 13:57:43 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/_static/js/landing_page.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/source/_static/js/landing_page.js b/doc/source/_static/js/landing_page.js index 42d556e9..980a43b4 100644 --- a/doc/source/_static/js/landing_page.js +++ b/doc/source/_static/js/landing_page.js @@ -21,7 +21,7 @@ function collectFamilies(data) { const icon = project.icon || "ansys-icon-light.svg"; // Fallback icon - projectFamilies.forEach(family => { + projectFamilies.forEach((family) => { if (family) { if (!familyData[family]) { familyData[family] = { count: 0, icon: icon }; @@ -249,15 +249,16 @@ function applyFilters() { projectCards.forEach((card) => { // Handle both single family and multiple families from data attributes - const rawFamilies = card.getAttribute("data-families") || card.getAttribute("data-family"); + const rawFamilies = + card.getAttribute("data-families") || card.getAttribute("data-family"); let cardFamilies = []; - + if (rawFamilies) { try { // Try to parse as JSON array first (for multiple families) - if (rawFamilies.startsWith('[')) { - cardFamilies = JSON.parse(rawFamilies.replace(/'/g, '"')).map((family) => - family.toLowerCase(), + if (rawFamilies.startsWith("[")) { + cardFamilies = JSON.parse(rawFamilies.replace(/'/g, '"')).map( + (family) => family.toLowerCase(), ); } else { // Single family as string @@ -283,8 +284,10 @@ function applyFilters() { // Check if the card matches the selected families const matchesAllFamilies = - selectedFamilies.length === 0 || - selectedFamilies.some(selectedFamily => cardFamilies.includes(selectedFamily)); + selectedFamilies.length === 0 || + selectedFamilies.some((selectedFamily) => + cardFamilies.includes(selectedFamily), + ); // Check if the card matches the selected tags const matchesAllTags = From b90b12915d27e52c806d269169e9d39b08f26b31 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 1 Aug 2025 15:36:38 +0200 Subject: [PATCH 4/4] fix: add families --- doc/source/_static/js/landing_page.js | 27 +++---- doc/source/api.rst | 2 +- doc/source/examples.rst | 2 +- doc/source/index.rst | 12 +--- doc/source/user_guide.rst | 2 +- projects.yaml | 100 +++++++++++++------------- 6 files changed, 64 insertions(+), 81 deletions(-) diff --git a/doc/source/_static/js/landing_page.js b/doc/source/_static/js/landing_page.js index 980a43b4..77326a04 100644 --- a/doc/source/_static/js/landing_page.js +++ b/doc/source/_static/js/landing_page.js @@ -11,13 +11,8 @@ function collectFamilies(data) { for (const project of projects) { if (!project || typeof project !== "object") continue; - // Handle both single family and multiple families - let projectFamilies = []; - if (project.families && Array.isArray(project.families)) { - projectFamilies = project.families; - } else if (project.family) { - projectFamilies = [project.family]; - } + // Handle families array + const projectFamilies = project.families || ["Other"]; const icon = project.icon || "ansys-icon-light.svg"; // Fallback icon @@ -248,22 +243,16 @@ function applyFilters() { const projectCards = document.querySelectorAll(".project-card"); projectCards.forEach((card) => { - // Handle both single family and multiple families from data attributes - const rawFamilies = - card.getAttribute("data-families") || card.getAttribute("data-family"); + // Handle families from data attributes + const rawFamilies = card.getAttribute("data-families"); let cardFamilies = []; if (rawFamilies) { try { - // Try to parse as JSON array first (for multiple families) - if (rawFamilies.startsWith("[")) { - cardFamilies = JSON.parse(rawFamilies.replace(/'/g, '"')).map( - (family) => family.toLowerCase(), - ); - } else { - // Single family as string - cardFamilies = [rawFamilies.toLowerCase()]; - } + // Parse as JSON array + cardFamilies = JSON.parse(rawFamilies.replace(/'/g, '"')).map( + (family) => family.toLowerCase(), + ); } catch (error) { // Fallback to treating as single family string cardFamilies = [rawFamilies.toLowerCase()]; diff --git a/doc/source/api.rst b/doc/source/api.rst index a6159fd5..5feeea1d 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -24,7 +24,7 @@ PyAnsys packages API reference :gutter: 3 3 4 4 {% for project, metadata in projects['projects'].items() %} - {% if 'Tools' not in metadata['family'] %} + {% if 'Tools' not in metadata.get('families', []) %} .. grid-item-card:: {{ metadata['name'] }} :img-top: {{ metadata['thumbnail'] }} :link: {{ metadata['documentation']['api'] }} diff --git a/doc/source/examples.rst b/doc/source/examples.rst index 7aa3df21..56ab70cf 100644 --- a/doc/source/examples.rst +++ b/doc/source/examples.rst @@ -19,7 +19,7 @@ PyAnsys packages examples :gutter: 3 3 4 4 {% for project, metadata in projects['projects'].items() %} - {% if 'Tools' not in metadata['family'] %} + {% if 'Tools' not in metadata.get('families', []) %} .. grid-item-card:: {{ metadata['name'] }} :img-top: {{ metadata['thumbnail'] }} :link: {{ metadata['documentation']['examples'] }} diff --git a/doc/source/index.rst b/doc/source/index.rst index 86cf729e..0439c26e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -22,15 +22,9 @@ it is now a collection of many Python packages for using Ansys products through

{% for project, metadata in projects['projects'].items() %} - {% if metadata.get('families') %} - {% set families = metadata.get('families', []) %} - {% set family_attr = families | join(',') | lower | replace(' ', '-') %} - {% set family_display = families[0] | lower | replace(' ', '-') %} - {% else %} - {% set families = [metadata.get('family', 'other')] %} - {% set family_attr = metadata.get('family', 'other') | lower | replace(' ', '-') %} - {% set family_display = metadata.get('family', 'other') | lower | replace(' ', '-') %} - {% endif %} + {% set families = metadata.get('families', ['Other']) %} + {% set family_attr = families | join(',') | lower | replace(' ', '-') %} + {% set family_display = families[0] | lower | replace(' ', '-') %} {% set tags = metadata.get('tags', []) %}