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

[0.2.dev2] Template for saving data #95

Merged
merged 20 commits into from
Mar 5, 2019
Merged

[0.2.dev2] Template for saving data #95

merged 20 commits into from
Mar 5, 2019

Conversation

smmaurer
Copy link
Member

@smmaurer smmaurer commented Feb 21, 2019

This PR adds a template for saving data to local files; see issue #94.

New template: urbansim_templates.data.SaveTable()

Template for saving an Orca table (or subset of a table) to disk as csv or hdf file. See docstrings and sphinx file for full documentation, which will appear online after this PR is merged.

Basic usage: Create an instance of the template class and set some properties (table, columns, output type, path, etc). Registering with ModelManager saves the settings to disk and creates an Orca step with instructions for saving the data. Running the object/step saves the current contents of the Orca table to disk.

Supports dynamic insertions into the filename string at runtime: run number, iteration, timestamp.

Other changes

Renames the data loading template for consistency: urbansim_templates.io.TableFromDisk() –> urbansim_templates.data.LoadTable().

Also changes some behavior in the LoadTable() template:

  • adds a model step name that's distinct from the table name
  • requires Unix-formatted file paths (too hard to reliably normalize)

Versioning

0.2.dev2

To do before merging

  • implement dynamic info in filenames
  • add column filters
  • update LoadTable() template to require Unix-formatted paths
  • update LoadTable() template to separate model step name from table name
  • finish tests and documentation
  • update changelog
  • finalize versioning

@smmaurer smmaurer mentioned this pull request Feb 27, 2019
8 tasks
@smmaurer smmaurer changed the title Template for saving data [0.2.dev2] Template for saving data Feb 28, 2019
@smmaurer smmaurer marked this pull request as ready for review March 5, 2019 00:23
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 91.601% when pulling da826b3 on save-data into 1c6c649 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 91.601% when pulling da826b3 on save-data into 1c6c649 on master.

@smmaurer smmaurer merged commit 61e6f7c into master Mar 5, 2019
@smmaurer smmaurer deleted the save-data branch March 5, 2019 00:32
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

Successfully merging this pull request may close these issues.

2 participants