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

RatInABox data saving #120

Open
TomGeorge1234 opened this issue Dec 17, 2024 · 3 comments
Open

RatInABox data saving #120

TomGeorge1234 opened this issue Dec 17, 2024 · 3 comments

Comments

@TomGeorge1234
Copy link
Collaborator

We should provide a standardised way to export RiaB data (times, trajectories and cell data). This follows on from a conversation I had with @niksirbi and @sfmig about integrating some functionality from RiaB into movement and vica versa.

The two ways this could be done are either each cell/agent has its own .save_history() function. Or else a single utils function could take all active agents / cells and save all data together into one file.

Option would be to then have a .load_history() function.

@niksirbi
Copy link
Contributor

I'm cross-linking this to other relevant issues/discussions for cross-reference:

We, in the movement project, are also in the process of figuring out export formats and the above threads have contain some relevant points.

Probably the most low-effort file format for exchanging trajectories between movement and RatInABox would be a tabular .csv file in a "tidy"/"tall" format. A contrived example follows:

time agent_id x y
0 Alice 35 22
0 Bob 100 120
1 Alice 37 25
1 Bob 102 121

Other columns can be added as needed, as long as we stick to the principle of "one variable - one column", and the valid column names are documented somewhere.

The advantage of csv is that it's simple, cross-language, and wouldn't necessitate adding any new dependencies to RatInABox. csv files can be written with native Python libraries - see example here.

@TomGeorge1234
Copy link
Collaborator Author

Hi @niksirbi I'm aware I haven't made progress on this. I'm very sorry! I have been (and probably will continue to be) a bit busy for the next month or so...is this currently bottlenecking you?

@niksirbi
Copy link
Contributor

Thanks for checking in, Tom. Don't worry about it at all, we haven't worked on it either and it's definitely not a bottleneck for us. It's more of a nice-to-have.

I can ping you when we get to this from our side, but there is definitely no urgency.

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