{
  "id": 551814,
  "title": "Error using Copick get_picks function",
  "url": "/competitions/czii-cryo-et-object-identification/discussion/551814",
  "author_name": "",
  "post_date": "2024-12-15T17:50:18.258840600Z",
  "votes": null,
  "comment_count": 4,
  "views": 0,
  "content": "<p>Hello all, I'm late to this party… Pls help me sort the error which I share below….</p>\n<p>I'm also attaching my <code>copick.config</code>, the dir structure is same as that on competition site…</p>\n<ul>\n<li>Data<ul>\n<li>train</li>\n<li>test</li>\n<li>submission.csv</li></ul></li>\n</ul>\n<p>Below is code causing the error : </p>\n<pre><code>\nroot = copick.from_file()\n = root.runs[0]\n(run.get_picks(=))\n</code></pre>\n<p>Error  :</p>\n<pre><code>---------------------------------------------------------------------------\nIndexError                                Traceback (most recent call last)\nCell In[], line \n       \n       (inspect.getdoc(run.get_picks))\n---&gt;  (run.get_picks(object_name=))\n      \n      picks = run.get_picks(object_name=)[]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3/lib/python3/site-packages/copick/models.py:,  CopickRun.get_picks(, object_name, user_id, session_id)\n      () -&gt; []:\n         \n--&gt;      ret = .picks\n          object_name   :\n             ret = [p  p  ret  p.pickable_object_name == object_name]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3/lib/python3/site-packages/copick/models.py:,  CopickRun.picks()\n     @\n      () -&gt; []:\n          ._picks  :\n...\n--&gt;  sessions = [n.split()[]  n  names]\n     objects = [n.split()[]  n  names]\n     \n\nIndexError:  index out of \n</code></pre>\n<p>Please help<br>\nThanks in advance</p>",
  "messages": [
    {
      "id": "3072866",
      "postDate": "12/15/2024 17:50:18",
      "content": "<p>Hello all, I'm late to this party… Pls help me sort the error which I share below….</p>\n<p>I'm also attaching my <code>copick.config</code>, the dir structure is same as that on competition site…</p>\n<ul>\n<li>Data<ul>\n<li>train</li>\n<li>test</li>\n<li>submission.csv</li></ul></li>\n</ul>\n<p>Below is code causing the error : </p>\n<pre><code>\nroot = copick.from_file()\n = root.runs[0]\n(run.get_picks(=))\n</code></pre>\n<p>Error  :</p>\n<pre><code>---------------------------------------------------------------------------\nIndexError                                Traceback (most recent call last)\nCell In[], line \n       \n       (inspect.getdoc(run.get_picks))\n---&gt;  (run.get_picks(object_name=))\n      \n      picks = run.get_picks(object_name=)[]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3/lib/python3/site-packages/copick/models.py:,  CopickRun.get_picks(, object_name, user_id, session_id)\n      () -&gt; []:\n         \n--&gt;      ret = .picks\n          object_name   :\n             ret = [p  p  ret  p.pickable_object_name == object_name]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3/lib/python3/site-packages/copick/models.py:,  CopickRun.picks()\n     @\n      () -&gt; []:\n          ._picks  :\n...\n--&gt;  sessions = [n.split()[]  n  names]\n     objects = [n.split()[]  n  names]\n     \n\nIndexError:  index out of \n</code></pre>\n<p>Please help<br>\nThanks in advance</p>",
      "rawMarkdown": "Hello all, I'm late to this party... Pls help me sort the error which I share below....\n\nI'm also attaching my ```copick.config```, the dir structure is same as that on competition site...\n  - Data\n      - train\n      - test\n      - submission.csv\n\nBelow is code causing the error : \n```\n# Get the first run in the project\nroot = copick.from_file(\"copick.config\")\nrun = root.runs[0]\nprint(run.get_picks(object_name=\"apo-ferritin\"))\n```\n\nError  :\n```\n---------------------------------------------------------------------------\nIndexError                                Traceback (most recent call last)\nCell In[25], line 10\n      8 # Get the docstring of the function\n      9 print(inspect.getdoc(run.get_picks))\n---> 10 print(run.get_picks(object_name=\"apo-ferritin\"))\n     11 # Get 'proteasome' picks of user 'alice'\n     12 picks = run.get_picks(object_name=\"apo-ferritin\")[0]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3.10/lib/python3.10/site-packages/copick/models.py:690, in CopickRun.get_picks(self, object_name, user_id, session_id)\n    679 def get_picks(self, object_name: str = None, user_id: str = None, session_id: str = None) -> List[\"CopickPicks\"]:\n    680     \"\"\"Get picks by name, user_id or session_id (or combinations).\n    681 \n    682     Args:\n   (...)\n    688         List[CopickPicks]: List of picks that match the search criteria.\n    689     \"\"\"\n--> 690     ret = self.picks\n    692     if object_name is not None:\n    693         ret = [p for p in ret if p.pickable_object_name == object_name]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3.10/lib/python3.10/site-packages/copick/models.py:656, in CopickRun.picks(self)\n    653 @property\n    654 def picks(self) -> List[\"CopickPicks\"]:\n    655     if self._picks is None:\n...\n--> 581 sessions = [n.split(\"_\")[1] for n in names]\n    582 objects = [n.split(\"_\")[2] for n in names]\n    584 # TODO: zip(strict=True) (replace once python 3.9 is EOL)\n\nIndexError: list index out of range\n```\n\nPlease help\nThanks in advance",
      "votes": null
    },
    {
      "id": "3073068",
      "postDate": "12/16/2024 02:23:03",
      "content": "<p>i  guess may the config something is wrong</p>",
      "rawMarkdown": "i  guess may the config something is wrong",
      "votes": null
    },
    {
      "id": "3074435",
      "postDate": "12/17/2024 17:15:09",
      "content": "<p><a href=\"https://www.kaggle.com/sarvagyaporwal\" target=\"_blank\">@sarvagyaporwal</a> check cell 3 in here <a href=\"https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&amp;cellId=3\" target=\"_blank\">https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&amp;cellId=3</a><br>\nthe filenames need to be tweaked when running on Kaggle</p>",
      "rawMarkdown": "sarvagyaporwal check cell 3 in here https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&cellId=3\nthe filenames need to be tweaked when running on Kaggle",
      "votes": null
    },
    {
      "id": "3075088",
      "postDate": "12/18/2024 13:52:19",
      "content": "<p>I got the issue, actually it accepts the annotation json of various labels to be named as <code>curation_0_ribosome.json</code> as it is splitting it internally and accessing it using indexes 0,1,2…</p>\n<p>I took it lightly that changing it to some other name wont affect anything… The deepFindET library is super insightful…<br>\nThanks for sharing…</p>",
      "rawMarkdown": "I got the issue, actually it accepts the annotation json of various labels to be named as ```curation_0_ribosome.json``` as it is splitting it internally and accessing it using indexes 0,1,2...\n\nI took it lightly that changing it to some other name wont affect anything... The deepFindET library is super insightful...\nThanks for sharing...",
      "votes": null
    },
    {
      "id": "3075089",
      "postDate": "12/18/2024 13:53:03",
      "content": "<p>not the config… but rather the naming convention of annotation jsons provided…</p>",
      "rawMarkdown": "not the config... but rather the naming convention of annotation jsons provided...",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 3073068,
      "author_name": "ggamazing",
      "author_url": "",
      "post_date": "12/16/2024 02:23:03",
      "content": "<p>i  guess may the config something is wrong</p>",
      "votes": null,
      "replies": [
        {
          "id": 3075089,
          "author_name": "sarvagyaporwal",
          "author_url": "",
          "post_date": "12/18/2024 13:53:03",
          "content": "<p>not the config… but rather the naming convention of annotation jsons provided…</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 3074435,
      "author_name": "kharrington",
      "author_url": "",
      "post_date": "12/17/2024 17:15:09",
      "content": "<p><a href=\"https://www.kaggle.com/sarvagyaporwal\" target=\"_blank\">@sarvagyaporwal</a> check cell 3 in here <a href=\"https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&amp;cellId=3\" target=\"_blank\">https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&amp;cellId=3</a><br>\nthe filenames need to be tweaked when running on Kaggle</p>",
      "votes": null,
      "replies": [
        {
          "id": 3075088,
          "author_name": "sarvagyaporwal",
          "author_url": "",
          "post_date": "12/18/2024 13:52:19",
          "content": "<p>I got the issue, actually it accepts the annotation json of various labels to be named as <code>curation_0_ribosome.json</code> as it is splitting it internally and accessing it using indexes 0,1,2…</p>\n<p>I took it lightly that changing it to some other name wont affect anything… The deepFindET library is super insightful…<br>\nThanks for sharing…</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "3072866": "Hello all, I'm late to this party... Pls help me sort the error which I share below....\n\nI'm also attaching my ```copick.config```, the dir structure is same as that on competition site...\n  - Data\n      - train\n      - test\n      - submission.csv\n\nBelow is code causing the error : \n```\n# Get the first run in the project\nroot = copick.from_file(\"copick.config\")\nrun = root.runs[0]\nprint(run.get_picks(object_name=\"apo-ferritin\"))\n```\n\nError  :\n```\n---------------------------------------------------------------------------\nIndexError                                Traceback (most recent call last)\nCell In[25], line 10\n      8 # Get the docstring of the function\n      9 print(inspect.getdoc(run.get_picks))\n---> 10 print(run.get_picks(object_name=\"apo-ferritin\"))\n     11 # Get 'proteasome' picks of user 'alice'\n     12 picks = run.get_picks(object_name=\"apo-ferritin\")[0]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3.10/lib/python3.10/site-packages/copick/models.py:690, in CopickRun.get_picks(self, object_name, user_id, session_id)\n    679 def get_picks(self, object_name: str = None, user_id: str = None, session_id: str = None) -> List[\"CopickPicks\"]:\n    680     \"\"\"Get picks by name, user_id or session_id (or combinations).\n    681 \n    682     Args:\n   (...)\n    688         List[CopickPicks]: List of picks that match the search criteria.\n    689     \"\"\"\n--> 690     ret = self.picks\n    692     if object_name is not None:\n    693         ret = [p for p in ret if p.pickable_object_name == object_name]\n\nFile ~/.cache/pypoetry/virtualenvs/cryoet-tomosight-Gnnz9bFw-py3.10/lib/python3.10/site-packages/copick/models.py:656, in CopickRun.picks(self)\n    653 @property\n    654 def picks(self) -> List[\"CopickPicks\"]:\n    655     if self._picks is None:\n...\n--> 581 sessions = [n.split(\"_\")[1] for n in names]\n    582 objects = [n.split(\"_\")[2] for n in names]\n    584 # TODO: zip(strict=True) (replace once python 3.9 is EOL)\n\nIndexError: list index out of range\n```\n\nPlease help\nThanks in advance",
    "3073068": "i  guess may the config something is wrong",
    "3074435": "sarvagyaporwal check cell 3 in here https://www.kaggle.com/code/kharrington/deepfindet-train?scriptVersionId=204524304&cellId=3\nthe filenames need to be tweaked when running on Kaggle",
    "3075088": "I got the issue, actually it accepts the annotation json of various labels to be named as ```curation_0_ribosome.json``` as it is splitting it internally and accessing it using indexes 0,1,2...\n\nI took it lightly that changing it to some other name wont affect anything... The deepFindET library is super insightful...\nThanks for sharing...",
    "3075089": "not the config... but rather the naming convention of annotation jsons provided..."
  },
  "source": "meta"
}