-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dummy inline arrays in asdf.util and weldxfile #469
Conversation
run memory test on osx again, do not garbage collect
Codecov Report
@@ Coverage Diff @@
## master #469 +/- ##
==========================================
+ Coverage 96.84% 96.86% +0.01%
==========================================
Files 89 89
Lines 5550 5547 -3
==========================================
- Hits 5375 5373 -2
+ Misses 175 174 -1
Continue to review full report at Codecov.
|
osx is still fucked up (most likely because it is a fucked up os). Linux and Windows do no need more than 10% memory now during serialization. I've patched the copy behavior of ndarrays, because asdf always deepcopies the tree. |
nice, really liking this solution |
before = get_mem_info()
fn = tempfile.mktemp(suffix=".wx", dir=tmpdir)
with WeldxFile(mode=mode) as fh:
fh["x"] = large_array
fh.show_asdf_header(use_widgets=False, _interactive=False)
fh.write_to(fn)
after = get_mem_info() Didn't really try to understand the whole test, but can't we move the second line out of the memcheck block? If we only want to check the memory footprint of
I would want to understand why it is failing before disabling it. Disabling a failing test just lets me ask: why do we have the test in the first place if it isn't that important. |
@vhirtham tempfile checks for an unused filename in $TEMPDIR and returns it. But the writeto method could involve larger memory footprints (e.g. buffers are kept in the background for whatever reason). I followed your advice and measure only the memory during show_asdf_header. And you are right about the test philosophy :) Still, osx sucks! |
Glad to hear that it worked. 😉 |
In case there are still issues with osx I prefer to mark the test as xfail on that platform for now, see https://docs.pytest.org/en/latest/how-to/skipping.html#condition-parameter |
I do not understand why pytest stdout capturing does not work for the print statement in |
there were some (probably unrelated issues) |
On another note can you explain the idea behind the |
The debug utility functions read_buffer and write_buffer will use WeldxFile internally, if the flag is set. Since these util functions are used extensively in the test suite, it increases the testing coverage of WeldxFile. There are two pytest flags to toggle this flag. I've also added a single pytest job to the matrix (just on Linux) to run this configuration. |
# Conflicts: # weldx/asdf/file.py # weldx/asdf/util.py # weldx/tests/asdf_tests/test_weldx_file.py
Hello @marscher! Thanks for updating this PR.
Comment last updated at 2021-08-20 12:04:57 UTC |
This reverts commit 64e0c5afb5088ece8d7dc9761f6806b7545cc231.
Changes
all_array_storage="internal"
we achieve zero additional output memory for array serialization. This is being checked with a test.WeldxFile
inside the read/write_buffer functions used in the testsuite. This increases the testing coverage of the class. Added a GH actions job to check this new configuration on Linux, py3.8 soley.Checks