Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests write files to disk #153

Open
pdiercks opened this issue Oct 24, 2023 · 0 comments
Open

Tests write files to disk #153

pdiercks opened this issue Oct 24, 2023 · 0 comments

Comments

@pdiercks
Copy link
Collaborator

I noticed that some of the tests or at least test_thermo_mechanical_cube
write xdmf files to disk for no apparent reason.

If there is a reason, but the files are not compared to some reference data afterwards, I would suggest that these could simply be temporary files. Something like

import tempfile
import pathlib

tf = tempfile.NamedTemporaryFile(suffix=".xmdf")
pv_name = pathlib.Path(tf.name).stem  # it seems class below does not want suffix?

# ... lots of code ...

problem_elastic = LinearElasticity(experiment, parameters, pv_name=f"{pv_name}_{dim}", pv_path="")
problem_elastic.solve()
problem_elastic.pv_plot()

tf.close()  # temporary file is deleted when closed
@srosenbu srosenbu added this to the Hackathon 2024 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants