-
Notifications
You must be signed in to change notification settings - Fork 85
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
JSON data missing #117
Comments
There is a map attribute: https://github.com/GraylinKim/sc2reader/blob/master/sc2reader/plugins/replay.py#L64 But now that I look at it I don't think it will work like it used to. The toJSON code was gifted by someone else and I have done a poor job updating as changes are made to the core library. I'll try to fix this one up for you. |
I saw this line, and i'm pretty sure I stay tuned, your work is greatly appreciated, thank you ;) |
What is your use case for the JSON plugin @qpautrat? Back when it was first written it encompassed almost all of the information available. Now-a-days it doesn't even come close to all the information available. Are you wishing that it would include more detailed data, like events and selections, or just all of the general replay data, like map_name, expansion, game_length, real_length, etc? |
@GraylinKim I think it will be great to have all data available. I don't have really specific needs here, so i'm trying to get all information. |
Okay @qpautrat, its going to be a busy couple weeks for me. Why don't you try adding the data you are looking for and pull request the solution that worked for you. I'd be happy to answer any questions that come up if you stop by the #sc2reader channel. If you'd prefer to wait then I'll see what I can do about this come May. |
I would like but like i said i'm not a Pyton dev, i'm not confortable with it, so i prefer let you handle this, sorry ;) |
I fixed the map issue by using map_name, and added the some other variables I found relevant in pull request #130 |
The sc2json script should be extended to provide more data and cover all major resource types. |
Hi @GraylinKim , I'm hoping to take a look at this when I have a chance, to get more familiar with the code. Is an updated sc2json script still required? Is it in use anywhere? Please elaborate on how it should be extended, if possible. Otherwise I will take a look and just try to add as much info as possible. |
Hi, thanks for volunteering! I would still like to maintain the sc2json script. I would also like to deprecate the import sc2reader
replay = sc2reader.load_replay(args.path[0])
json.dumps(replay, cls=sc2reader.utils.JsonEncoder()) I think this is a good approach because it keeps all the json converting clutter out of the main code base and if people don't like our serialization they can either extend our encoder or just copy/paste and edit to their satisfaction. I imagine this JsonEncoder looking something like this gist where I stole most of the code from the existing toDict function. Maybe the conversion for each class would be broken out into a function for readability or obj.dict could be used more heavily. What do you think about this? I'm open to other approaches. |
Sounds good, I'll give that a bash. Thanks! |
Hey @GraylinKim please have a look at this pull request #157 |
Yes, I saw the request. Thanks. I won't have time to look at this until this weekend. |
Thanks for the feedback, will take a look this week hopefully. For testing do you just run the script over all the replays in the repo? |
Examine some results by hand first. Once you are happy with them it would be good to run over the whole set of replays; they cover a wide variety of edge cases you might run into. Once you get things in a good place it would also be good to add some regression tests (that verify the json output) to the test suite to protect against breaks as I continue working on the library. |
So this is an n00b question but this seems like the appropriate thread as everyone is working on a json solution here with a lot more success than I am. I'm primarily a JS dev so only have very limited python experience. I'm really interested in visualizing this replay data over time using the svg library D3 similar to the awesome ggtracker.com but to do something different. I've gone through the docs and am struggling a bit about where one should begin to get all the replay data dumped into a json file. I was able to run the following file in the scripts folder which is encouraging...
...but this just dumps out a summary not the full replay data. So either my replay only contains a summary or am I'm not unlocking the rest of the data properly. How does one dump the full replay into json? Perhaps we could turn this discussion into some documentation on the wiki ;-D I looked for a json wiki page without any luck - can you point to it or can we create one? |
This isn't a problem with your replay, it is a limitation of the sc2json With the current code base you will need to write your own script that A partial solution #157 has Does that answer your questions? On Thu, Jan 30, 2014 at 12:31 PM, brandon flowers
|
Yes it does! thank you very much. Since there is interest from other JS devs, let's not have them go digging through the weeds like I just did... Let's improve the path to this gold On the main readme.md file, can you simply add a heading like Exporting Data to JSON and link to a wiki page about it. For now, just dump that answer ;-D I'd be happy to help edit and contribute feedback from a JS dev's view. In the meantime, I'll also roll up my sleeves and learn some more python to play around with your dictionary recommendation. thanks again! |
Hello again,
Why some valuable data from replay are missing into JSON plugin?
Maybe i make a mistake but for example
map
attribute is not define, so we can't get map name.Thanks!
The text was updated successfully, but these errors were encountered: