Skip to content

Commit

Permalink
Remove examples from README.md
Browse files Browse the repository at this point in the history
They were moved to their own wiki page.
  • Loading branch information
DivvyCr committed May 5, 2020
1 parent 7f188c8 commit 08646a3
Showing 1 changed file with 2 additions and 56 deletions.
58 changes: 2 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,63 +38,9 @@ python init.py
```

## Examples / Usage
One of the main data structures used in carball is the pandas.DataFrame, to learn more, see [its wiki page](https://github.com/SaltieRL/carball/wiki/data_frame).
The GitHub carball wiki has a lot of useful information about using carball. Including the most useful examples to get started with carball, which can be found [here](https://github.com/SaltieRL/carball/wiki/All-Examples "Examples").

Decompile and analyze a replay:
```Python
import carball

analysis_manager = carball.analyze_replay_file('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
proto_game = analysis_manager.get_protobuf_data()

# you can see more example of using the analysis manager below

```

Just decompile a replay to a JSON object:

```Python
import carball

_json = carball.decompile_replay('9EB5E5814D73F55B51A1BD9664D4CBF3.replay',
output_path='9EB5E5814D73F55B51A1BD9664D4CBF3.json',
overwrite=True)
```

Analyze a JSON game object:
```Python
import carball
import os
import gzip
from carball.json_parser.game import Game
from carball.analysis.analysis_manager import AnalysisManager
# _json is a JSON game object (from decompile_replay)
game = Game()
game.initialize(loaded_json=_json)

analysis_manager = AnalysisManager(game)
analysis_manager.create_analysis()

# write proto out to a file
# read api/*.proto for info on the object properties
with open(os.path.join('output.pts'), 'wb') as fo:
analysis_manager.write_proto_out_to_file(fo)

# write pandas dataframe out as a gzipped numpy array
with gzip.open(os.path.join('output.gzip'), 'wb') as fo:
analysis_manager.write_pandas_out_to_file(fo)

# return the proto object in python
proto_object = analysis_manager.get_protobuf_data()

# return the proto object as a json object
json_oject = analysis_manager.get_json_data()

# return the pandas data frame in python
dataframe = analysis_manager.get_data_frame()
```
One of the main data structures used in carball is the pandas.DataFrame, to learn more, see [its wiki page](https://github.com/SaltieRL/carball/wiki/data_frame "DataFrame").

### Command Line

Expand Down

3 comments on commit 08646a3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_sample

Benchmark suite Current: 08646a3 Previous: 7f188c8 Ratio
carball/tests/benchmarking/benchmarking.py::test_short_sample 0.7982194192000649 iter/sec (stddev: 0.0223872203032035) 0.8930344604838997 iter/sec (stddev: 0.010219842775693095) 1.12

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks short_dropshot

Benchmark suite Current: 08646a3 Previous: 7f188c8 Ratio
carball/tests/benchmarking/benchmarking.py::test_short_dropshot 0.5600696041779281 iter/sec (stddev: 0.04736440309631572) 0.6077960552972108 iter/sec (stddev: 0.14301398941268187) 1.09

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carball Benchmarks intensive_oce_rlcs

Benchmark suite Current: 08646a3 Previous: 7f188c8 Ratio
carball/tests/benchmarking/benchmarking.py::test_intensive_oce_rlcs 0.04820609657271643 iter/sec (stddev: 0.1730107810230897) 0.06158342967316056 iter/sec (stddev: 0.19138208928114414) 1.28

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.