Combine Dataloader and Dataset class into EnvironmentInterface

Hello! I wanted to give an update as it’s been a while since I last posted: I spent some time debugging another segfault, this time caused by the test_can_save_and_load test in base_config.py, where more than one experiment was created in a single test, and management of the simulator environment wasn’t correctly handled. When I ran the test on its own it was successful, but running it with the other tests in the file caused the segfault. Commenting out the second with context manager/experiment block also avoided the issue.

As before, the error happened outside the python scope in the clean up logic of the underlying C++ libraries, triggered by incorrect resource management.

To fix it, I moved the Dataloader close() method, which handles closing the environment, to the MontyExperiment class, which makes sense as that’s now where we’re instantiating the environment in the first place.

Tests are all passing now, and I’m onto step 3 of Tristan’s outline.

1 Like

Hi @annark that is great! Thanks for doing all this refactoring and debugging, and figuring out these issues :folded_hands:

It sounds like this is a good point to integrate what you did into tbp.monty :tada: Would you be ready to move Combine Dataloader and Dataset classes into EnvironmentInterface by annark · Pull Request #448 · thousandbrainsproject/tbp.monty · GitHub out of draft mode? Then step three of renaming everything to EnvironmentInterface could be a follow-on PR, which would make everything a bit easier to review.

Again, thank you for all the work you put into this!

  • Viviane
1 Like

Thanks Viviane. Yes, I’m happy to move that PR out of draft mode - I’ll ensure it’s ready and do that within the next two days. I’ve been conscious of how large this PR is getting, so breaking the work into smaller steps feels like a great plan.

It’s my pleasure to do this - I’ve really enjoyed learning more about the codebase through this task!
Anna

1 Like

Hi @vclay and @tslominski,

The PR as discussed is ready for review: Combine Dataloader and Dataset classes into EnvironmentInterface by annark · Pull Request #448 · thousandbrainsproject/tbp.monty · GitHub

I look forward to any feedback. Thank you!
Anna

2 Likes

Hello @vclay and @tslominski,

The next steps of this work are ready for review in this PR.

I look forward to the review process.

2 Likes

As your PR is now merged, I thought you may enjoy this :slight_smile: Thank you for contributing! You are the first to check off a large item on our future work roadmap :mechanical_arm: :tada:

FutureWorkItemCheckOff

5 Likes

Ah this is great to see, thank you! So happy to have been able to contribute.

1 Like