ansys / ansys/pyfluent

Add utilities for reading report files for dataprocessing

Open
#4,854 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
497
Forks
77
Avg merge
22h 37m
Merged PRs (30d)
45

Description

### 📝 Description of the feature

Say I've just created a report monitor and added a report_file

```py
monitor = Monitor(solver)
temp_file = monitor.report_files.create(name="max-temperature")
temp_file.report_defs = [max_pad_temp.name, max_disc_temp.name, "flow-time"]
temp_file.file_name = "max-temperature.out"
```

There's no easy way as far as I'm aware to process the data that comes out of this.

Currently you have to parse this yourself and it's not particularly user friendly

```py
###############################################
# Read monitor file
# -----------------

X = []
Y = []
Z = []

with (Path.cwd() / "max-temperature.out").open() as datafile:
for rows in csv.reader(
itertools.islice(datafile, 3, None), # skip header lines
delimiter=" ",
):
X.append(float(rows[3]))
Y.append(float(rows[2]))
Z.append(float(rows[1]))
```

can we have some kind of API like

```py
temp_file.parse() -> DataFrame with surface names etc
```

### 💡 Steps for implementing the feature

report_files_child needs a parse method adding there are maybe other places this would be useful, feel free to chime in

### 🔗 Useful links and references

Might be a duplicate of #4734 section D.

Contributor guide

Open the contributing guide

Research direction

Start by reading report_files_child and the report file format shown in the issue, including its header lines and column layout. Trace how report files are created and exposed by report_files, then define what parse() should return for surface names and measured data. Done means report files can be processed through the proposed DataFrame-oriented API instead of requiring manual CSV parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.