Skip to content

Commit

Permalink
Merge pull request #13 from stone-tech-inc/feature/multi-save-time-se…
Browse files Browse the repository at this point in the history
…ries

Multi-save time-series analysis
  • Loading branch information
viperior authored Feb 15, 2022
2 parents 71a8a63 + 3e68e3e commit 471d215
Show file tree
Hide file tree
Showing 19 changed files with 612 additions and 122 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --max-complexity=10 --max-line-length=100 --statistics
- name: Test with pytest
run: |
cp config.json.example config.json
python -m coverage run -m pytest -v tests/
python -m coverage run -m pytest -v
coverage report -m --fail-under 100
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [0.5.0](https://github.com/stone-tech-inc/rimhistory/tree/v0.5.0) (2022-02-15)

### New features

* Use data from a series of save files to produce time-series datasets and visualizations
* Each dataset is extracted from a series of save files and stored in pandas DataFrames internally
* The in-game time is extracted from each save file and added to the data model for use as a time dimension
* Null handling logic passes a `None` value into the pandas DataFrame when data is missing, such as missing plant age, pawn ambient temperature, or pawn first name

### Improvements

* Reduce memory usage by deleting the XML root element as soon as possible after instantiating a Save object
* Bump `pandas` to 1.4.1
* Bump `pytest` to 7.0.1
* Configure `flake8` errors to halt the GitHub Actions build process
* Clean up code style issues raised by `flake8`

### Notes

Example chart generated from 167 save files:
![Example line chart visualizing flora population by species over time](docs/images/sample_line_chart_plant_population_by_species_over_time.png)

Performance for large file sets:
During testing, the latest version was able to process 167 sequential save files in 124 seconds. This allows users with a large number of saves to load them all without too long of a wait. This could be sped up further by refactoring the SaveSeries class to initialize its Save objects asynchronously.

## [0.4.0](https://github.com/stone-tech-inc/rimhistory/tree/v0.4.0) (2022-02-11)

### Improvements
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
RimWorld game save data analyzer

![build](https://github.com/stone-tech-inc/rimhistory/actions/workflows/python-app.yml/badge.svg)

## Example visualization

![Example line chart visualizing flora population by species over time](docs/images/sample_line_chart_plant_population_by_species_over_time.png)
4 changes: 3 additions & 1 deletion config.json.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"processed_save_file_path": "data/processed.rws",
"rimworld_save_file_path": "data/sample_rimworld_save.rws"
"rimworld_save_file_dir": "data",
"rimworld_save_file_path": "data/sample_rimworld_save.rws",
"rimworld_save_file_series_pattern": "sample_rimworld_save"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 471d215

Please sign in to comment.