Server-side subsample: extract at most N points from field_data and solution_variable_data (SVARs)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by tracing SurfaceFieldDataRequest and fields.field_data, then inspect fields.solution_variable_data.get_data and their tests to understand how data is extracted and streamed. The issue proposes optional sampling for both paths, with a configurable size and possibly seed and method; define behavior that returns at most N points while preserving the current full-data default, then verify both extraction paths.
Written by the indexing model from the issue text.
Description
❓ Problem statement
For large cases, clients often need only a random (or stratified) sample of N points for downstream work (e.g. ML inference), but today both APIs force a full-zone transfer, then the user must subsample in NumPy.
1. fields.field_data / SurfaceFieldDataRequest (e.g. SurfaceDataType.Vertices)
- Every requested surface zone returns all vertices.
- On cases with many wall zones (or very large walls), full extract can be slow, memory-heavy, or destabilize Fluent (e.g. cortex faults) even when only N points are needed afterward.
2. fields.solution_variable_data.get_data (SVARs, e.g. SV_CENTROID)
- For huge fluid zones (O(1e8) cells), the payload is multi‑GB.
- In practice the gRPC stream can fail or return incomplete/
None-like data, so clients cannot even reach a post-hocnp.random.choicesubsample.
Why current behavior is insufficient
- Over-fetch: API always materializes the full array client-side.
- No server-side N: there is no first-class
n_max/sample_size/strideon these requests. - Fragile at scale: full
SV_CENTROIDfor main fluid zones is often the blocker for production workflows that only need a representative sample.
We need the sample to be taken in Fluent (or on the nodes) before/during streaming, not after a successful full download.
To reproduce :
vol = solver.fields.solution_variable_data.get_data(
variable_name="SV_CENTROID",
zone_names=[z],
domain_name=domain,
)[z]
pts = np.asarray(vol).reshape(-1, 3) # fails or OOMs on huge zones
💡 Proposed solution
Add optional server-side sampling to both extract paths so the client can request at most N points (default: current behavior = all).
A. Field data (surfaces)
Extend SurfaceFieldDataRequest (and/or get_field_data) with something like:
SurfaceFieldDataRequest(
surfaces=[...],
data_types=[SurfaceDataType.Vertices], # and ideally FaceCentroids later
sample_size=1_000_000, # or n_max=
sample_seed=42, # optional, for reproducibility
sample_method="random", # or "stride" / "uniform"
)
- Dominant language
- Python
- Stars
- 550
- Forks
- 86
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 58
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ansys/pyfluent
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ansys/pyfluent#5515 · 2 reactions ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
[DOC]: DOE_ML: Update the keras model definition to match the supported APIPossibly taken A pull request linked to this issue is open or already merged. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[DOC]: Lunar Lander Outdated APIPossibly taken A pull request linked to this issue is open or already merged. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
Similar issues
-
`gitlab_importer_v2` pipeline failing due to malformed YAML filePossibly taken @Gowri213 claimed this today. Openbug Pipeline: Failure Priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aboutcode-org/vulnerablecode#2523 · 1 comment ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
intuitem/ciso-assistant-community#5380 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
confluentinc/cp-ansible#2767 ·
Maintainers usually reply within 3 days
-
bug docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
Maintainers usually reply within 2 days