{
  "id": 384814,
  "title": "You can only call once? DEBUG mode",
  "url": "/competitions/predict-student-performance-from-game-play/discussion/384814",
  "author_name": "",
  "post_date": "2023-02-09T16:08:11.294012100Z",
  "votes": 88,
  "comment_count": 9,
  "views": 0,
  "content": "<p>It can be noticed that we only can call once the method <code>.make_env</code> and iterate once through <code>iter_test</code> iterator. We got exceptions like <code>Exception: You can only call make_env() once.</code> and <code>Exception: You can only iterate over iter_test() once.</code> if we call these routines twice.</p>\n<p>This can be inconvenient when debugging code locally.</p>\n<p>To reload your enviroment without rerunning main process you can do<br>\n<code>jo_wilder.make_env.__called__ = False</code>.<br>\nAnd to reload your iterator and have possibility iterate again you can do this<br>\n<code>type(env)._state = type(type(env)._state).__dict__['INIT']</code>.</p>\n<p><strong>Note</strong>: This should not work during submit. So use it only for debugging!</p>",
  "messages": [
    {
      "id": "2136903",
      "postDate": "02/09/2023 16:08:11",
      "content": "<p>It can be noticed that we only can call once the method <code>.make_env</code> and iterate once through <code>iter_test</code> iterator. We got exceptions like <code>Exception: You can only call make_env() once.</code> and <code>Exception: You can only iterate over iter_test() once.</code> if we call these routines twice.</p>\n<p>This can be inconvenient when debugging code locally.</p>\n<p>To reload your enviroment without rerunning main process you can do<br>\n<code>jo_wilder.make_env.__called__ = False</code>.<br>\nAnd to reload your iterator and have possibility iterate again you can do this<br>\n<code>type(env)._state = type(type(env)._state).__dict__['INIT']</code>.</p>\n<p><strong>Note</strong>: This should not work during submit. So use it only for debugging!</p>",
      "rawMarkdown": "It can be noticed that we only can call once the method `.make_env` and iterate once through `iter_test` iterator. We got exceptions like `Exception: You can only call make_env() once.` and `Exception: You can only iterate over iter_test() once.` if we call these routines twice.\n\nThis can be inconvenient when debugging code locally.\n\nTo reload your enviroment without rerunning main process you can do\n`jo_wilder.make_env.__called__ = False`.\nAnd to reload your iterator and have possibility iterate again you can do this\n`type(env)._state = type(type(env)._state).__dict__['INIT']`.\n\n**Note**: This should not work during submit. So use it only for debugging!",
      "votes": null
    },
    {
      "id": "2136971",
      "postDate": "02/09/2023 16:43:09",
      "content": "<p>Thanks for the tip</p>",
      "rawMarkdown": "Thanks for the tip",
      "votes": null
    },
    {
      "id": "2137759",
      "postDate": "02/10/2023 10:05:39",
      "content": "<p>Thanks so much for the info in your post! The workaround you shared for reloading the environment and iterator during debugging was super helpful and saved me a ton of time.</p>",
      "rawMarkdown": "Thanks so much for the info in your post! The workaround you shared for reloading the environment and iterator during debugging was super helpful and saved me a ton of time.",
      "votes": null
    },
    {
      "id": "2138223",
      "postDate": "02/10/2023 16:51:26",
      "content": "<p>Nice workaround!</p>",
      "rawMarkdown": "Nice workaround!",
      "votes": null
    },
    {
      "id": "2144103",
      "postDate": "02/14/2023 18:28:19",
      "content": "<p>Does it only work for this competition or are there others?</p>",
      "rawMarkdown": "Does it only work for this competition or are there others?",
      "votes": null
    },
    {
      "id": "2153162",
      "postDate": "02/21/2023 08:38:36",
      "content": "<p>I guess it works for any other competition with similar time series submission API. As I remember it is universal library for such cases. </p>",
      "rawMarkdown": "I guess it works for any other competition with similar time series submission API. As I remember it is universal library for such cases.",
      "votes": null
    },
    {
      "id": "2186999",
      "postDate": "03/18/2023 10:36:17",
      "content": "<p>Thanks a lot for sharing! I am curious, how did you come up with that?</p>",
      "rawMarkdown": "Thanks a lot for sharing! I am curious, how did you come up with that?",
      "votes": null
    },
    {
      "id": "2197607",
      "postDate": "03/26/2023 08:48:04",
      "content": "<p>I have experienced in reverse engineering ;)</p>",
      "rawMarkdown": "I have experienced in reverse engineering ;)",
      "votes": null
    },
    {
      "id": "2199858",
      "postDate": "03/28/2023 05:28:28",
      "content": "<p>I see thanks for answering!</p>",
      "rawMarkdown": "I see thanks for answering!",
      "votes": null
    },
    {
      "id": "2218150",
      "postDate": "04/11/2023 13:16:02",
      "content": "<p>Thanks a lot for sharing!</p>",
      "rawMarkdown": "Thanks a lot for sharing!",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2136971,
      "author_name": "cdeotte",
      "author_url": "",
      "post_date": "02/09/2023 16:43:09",
      "content": "<p>Thanks for the tip</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2137759,
      "author_name": "foolishboi",
      "author_url": "",
      "post_date": "02/10/2023 10:05:39",
      "content": "<p>Thanks so much for the info in your post! The workaround you shared for reloading the environment and iterator during debugging was super helpful and saved me a ton of time.</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2138223,
      "author_name": "diegokauerl",
      "author_url": "",
      "post_date": "02/10/2023 16:51:26",
      "content": "<p>Nice workaround!</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 2144103,
      "author_name": "mikhaildonskoy",
      "author_url": "",
      "post_date": "02/14/2023 18:28:19",
      "content": "<p>Does it only work for this competition or are there others?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2153162,
          "author_name": "sggpls",
          "author_url": "",
          "post_date": "02/21/2023 08:38:36",
          "content": "<p>I guess it works for any other competition with similar time series submission API. As I remember it is universal library for such cases. </p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 2186999,
      "author_name": "cherrytomatech",
      "author_url": "",
      "post_date": "03/18/2023 10:36:17",
      "content": "<p>Thanks a lot for sharing! I am curious, how did you come up with that?</p>",
      "votes": null,
      "replies": [
        {
          "id": 2197607,
          "author_name": "sggpls",
          "author_url": "",
          "post_date": "03/26/2023 08:48:04",
          "content": "<p>I have experienced in reverse engineering ;)</p>",
          "votes": null,
          "replies": [
            {
              "id": 2199858,
              "author_name": "cherrytomatech",
              "author_url": "",
              "post_date": "03/28/2023 05:28:28",
              "content": "<p>I see thanks for answering!</p>",
              "votes": null,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 2218150,
      "author_name": "byungeunhwang",
      "author_url": "",
      "post_date": "04/11/2023 13:16:02",
      "content": "<p>Thanks a lot for sharing!</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "2136903": "It can be noticed that we only can call once the method `.make_env` and iterate once through `iter_test` iterator. We got exceptions like `Exception: You can only call make_env() once.` and `Exception: You can only iterate over iter_test() once.` if we call these routines twice.\n\nThis can be inconvenient when debugging code locally.\n\nTo reload your enviroment without rerunning main process you can do\n`jo_wilder.make_env.__called__ = False`.\nAnd to reload your iterator and have possibility iterate again you can do this\n`type(env)._state = type(type(env)._state).__dict__['INIT']`.\n\n**Note**: This should not work during submit. So use it only for debugging!",
    "2136971": "Thanks for the tip",
    "2137759": "Thanks so much for the info in your post! The workaround you shared for reloading the environment and iterator during debugging was super helpful and saved me a ton of time.",
    "2138223": "Nice workaround!",
    "2144103": "Does it only work for this competition or are there others?",
    "2153162": "I guess it works for any other competition with similar time series submission API. As I remember it is universal library for such cases.",
    "2186999": "Thanks a lot for sharing! I am curious, how did you come up with that?",
    "2197607": "I have experienced in reverse engineering ;)",
    "2199858": "I see thanks for answering!",
    "2218150": "Thanks a lot for sharing!"
  },
  "source": "meta"
}