Giter VIP home page Giter VIP logo

Comments (3)

toonarmycaptain avatar toonarmycaptain commented on August 22, 2024

GitMate.io thinks possibly related issues are #84 (Make chart images save in correct folder.), #67 (Make avatar images save in correct folder. ), #17 (Logic for image generation), and #33 (Take avatar images and process them).

from dionysus.

toonarmycaptain avatar toonarmycaptain commented on August 22, 2024

Remove app_data/image_data folder since it will not be used.

from dionysus.

toonarmycaptain avatar toonarmycaptain commented on August 22, 2024

Complete: Issue appeared with JSON:

Initial test failed on mirrored convert_to_json data:

json_data_to_convert = '{\n    "1": "a",\n    "b": 2,\n    "3": "c",\n    "d": 4\n}'
converted_json_data = {1: 'a', 'b': 2, 3: 'c', 'd': 4}

This is because JSON does not have integer dict keys, so it converts the
integer keys to strings. When loading from JSON, json.loads does not
differentiate between dict keys of stings containing integers and
keys of integers converted to strings when converted to JSON.
Thus the test data was modified to expect strings in test of integers
as dict keys: {"1": 'a', 'b': 2, "3": 'c', 'd': 4}.

So test runs as:

json_data_to_convert = '{\n    "1": "a",\n    "b": 2,\n    "3": "c",\n    "d": 4\n}'
converted_json_data = {"1": 'a', 'b': 2, "3": 'c', 'd': 4}

assert load_from_json(json_data_to_convert) == converted_json_data

Added notes to file_functions.py functions convert_to_json,
load_from_json, in create_chart.py to write_chart_data_to_file, and in
class_functions.py to write_classlist_to_file describing this behaviour,
as it will be an issue if and when chart_data_files are reloaded, since
the keys in score-avatar_dicts are float values which are converted to
strings when converted to JSON, and this will need to be handled.

Handling will probably be as simple as
original_score_avatar_dict = {float(score): avatar_list for score, avatar_list in dejsonified_score_avatar_dict.items()}

from dionysus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.