Skip to content

Commit

Permalink
Merge release/3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
sebosp committed Mar 1, 2024
2 parents 4d6bbf4 + a97c5f5 commit babc581
Show file tree
Hide file tree
Showing 27 changed files with 286 additions and 14,704 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ Cargo.lock
**/*.rs.bk

ipcs/

jupyter_notebooks/.ipynb_checkpoints/
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "s2protocol"
description = "A parser for Starcraft II - Replay format, exports to different target formats"
version = "3.0.3"
version = "3.0.4"
authors = ["Seb Ospina <[email protected]>"]
edition = "2021"
readme = "README.md"
Expand All @@ -19,7 +19,7 @@ clap = { version = "4.4", features = ["derive"] }
serde_json = "1.0.91"
serde = { version = "1.0.164", features = ["derive"] }
convert_case = "0.6.0"
nom-mpq = "2.0.1"
nom-mpq = "2.0.2"
colored = "2.0.4"
arrow2 = { version = "0.17.0", features = ["io_print", "io_ipc"], optional = true }
arrow2_convert = { version = "0.5.0", optional = true }
Expand Down
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ information it packs.

From the available data, analytics, visualizations and generative art can be created, for example
by using
- jupyter notebook in [s2-polars-data-analysis](https://github.com/sebosp/s2-polars-data-analysis)
- [rerun](https://github.com/rerun-io/rerun) : See the repo [swarmy](https://github.com/sebosp/swarmy)
- [lyon](https://github.com/nical/lyon) (PoC in progress in cooper)
- [yew](https://github.com/yewstack/yew) [cooper](https://github.com/sebosp/cooper)
- [eframe/egui](https://github.com/emilk/egui): See repo [eframes-c2](https://github.com/sebosp/eframe-sc2)
- [bevyengine/bevy](https://github.com/bevyengine/bevy) can be used to see:
Expand Down Expand Up @@ -85,18 +85,7 @@ Total time: 33.654286961s

### Jupyter Notebooks

```
$ virtualenv new venv
$ source ./venv/bin/activate
$ pip install -r requirements.txt
$ jupyter lab
```

Then open your browser and locate the Notebbooks, for example:

[Basic UnitBorn Queries](./jupyter_notebooks/Basic-UnitBorn-Queries.ipynb)
![All units born](https://github.com/sebosp/s2protocol-rs/assets/873436/2307780a-bc62-4cd4-9daf-a3e622bdb5b7)
![Most effective units across all games](https://github.com/sebosp/s2protocol-rs/assets/873436/cba9da20-a034-47f3-9016-bfd6db21247b)
The jupyter notebook with examples on how to interact with the data are available in [s2-polars-data-analysis](https://github.com/sebosp/s2-polars-data-analysis)

### polars-cli

Expand Down Expand Up @@ -141,13 +130,6 @@ $ # List the max number of minerals that were lost in per map when the army was
- [ ] Support for MPQ embedded file: `replay.gamemetadata.json`
- [ ] Support for MPQ embedded file: `replay.attributes.events`

## Current issues

In the arrow file generation, sha256 digest is used to detect duplication/etc.
This inflates the size of the rows. Even tho it's slightly less than long directory names.
Perhaps using short rev-parse for sha256 may be better, find something like 7-characters unique combinations
And use that instead of the long sha256 form.

## version compatibility.

After a bit of testing, it seems most of the types are compatible between versions, so only when they differ would they make part of the protocol version.
Expand All @@ -171,7 +153,7 @@ RUST_LOG_SPAN_EVENTS=full RUST_LOG=debug cargo watch -i src/versions/protocol897
# Additionally some code to transform from Protocol-Specific to Protocol-Agnostic was added, TODO: Add to generator.rs
```

## JSON Sources
## JSON Spec Sources

[Blizzard/s2protocol repo](https://github.com/Blizzard/s2protocol)

14,305 changes: 0 additions & 14,305 deletions jupyter_notebooks/Basic-Unit-Queries.ipynb

This file was deleted.

77 changes: 0 additions & 77 deletions jupyter_notebooks/functime.ipynb

This file was deleted.

172 changes: 0 additions & 172 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/arrow/ipc_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn write_batches(
schema: arrow2::datatypes::Schema,
chunks: &[Chunk<Box<dyn Array>>],
) -> Result<(), Box<dyn std::error::Error>> {
let file = std::fs::File::create(&path)?;
let file = std::fs::File::create(path)?;

let options = arrow2::io::ipc::write::WriteOptions { compression: None };
let mut writer = arrow2::io::ipc::write::FileWriter::new(file, schema, None, options);
Expand Down
Loading

0 comments on commit babc581

Please sign in to comment.