Skip to content
Snippets Groups Projects
  • Enric Tejedor Saavedra's avatar
    0b234462
    Ensure JSON is sorted when dumping it in the notebook. · 0b234462
    Enric Tejedor Saavedra authored
    In Python2, the dumps function of the json module always returns the
    same JSON string for a given Python dictionary across different runs.
    In Python3, the returned JSON changes across runs, in particular the
    order in which dictionary keys are shown, which complicates the
    notebook tests of the interactive neural networks. Only with a sorted
    JSON we can compare the newly generated notebook with a reference notebook.
    0b234462
    History
    Ensure JSON is sorted when dumping it in the notebook.
    Enric Tejedor Saavedra authored
    In Python2, the dumps function of the json module always returns the
    same JSON string for a given Python dictionary across different runs.
    In Python3, the returned JSON changes across runs, in particular the
    order in which dictionary keys are shown, which complicates the
    notebook tests of the interactive neural networks. Only with a sorted
    JSON we can compare the newly generated notebook with a reference notebook.