{
 "cranqe_package": "pyena",
 "dev_metadata": {
  "author": "",
  "description": "# pyena\n\nPython implementation of Epistemic Network Analysis (ENA) \u2014 sister package to [`rENA`](../README.md).\n\n`pyena` delegates all core math to [`pylibqe`](https://gitlab.com/epistemic-analytics/qe-packages/libqe),\nthe shared C++ library that also powers rENA.\n\n---\n\n## Installation\n\n`pyena` requires `pylibqe`. Install both from the QE package index:\n\n```bash\npip install pyENA \\\n  --index-url https://qe-libs.org/py/simple/ \\\n  --extra-index-url https://pypi.org/simple/\n```\n\n### Development install\n\n```bash\npip install pylibqe \\\n  --index-url https://qe-libs.org/py/simple/ \\\n  --extra-index-url https://pypi.org/simple/\n\npip install -e \".[dev]\"   # from python/ directory\n```\n\n---\n\n## Quick Start\n\n```python\nimport pandas as pd\nfrom pyena import ENA\n\nrs = pd.read_csv(\"../inst/extdata/rs.data.csv\")   # rENA's RS.data\n\nCODES = [\"Data\", \"Technical Constraints\", \"Performance Parameters\",\n         \"Client and Consultant Requests\", \"Design Reasoning\", \"Collaboration\"]\n\n# Units and conversations as rENA's RS.data examples: units by Condition +\n# UserName, conversations by Condition + GroupName.\nrs[\"unit_key\"]  = rs[\"Condition\"] + \"::\" + rs[\"UserName\"]\nrs[\"convo_key\"] = rs[\"Condition\"] + \"::\" + rs[\"GroupName\"]\n\nmodel = ENA().fit(rs, \"unit_key\", \"convo_key\", CODES, window_size=4)\n```\n\n---\n\n## Plotting\n\npyENA models plot with [qeviz](https://qe-libs.org/py/project/qeviz/), the\ninteractive ENA / ONA network viewer used by rENA (`pip install qeviz\n--index-url https://qe-libs.org/py/simple/`). The two conditions compared \u2014\nFirstGame \u2212 SecondGame, with each group's mean and 95% confidence interval:\n\n```python\nimport qeviz\n\np = (qeviz.from_pyena(model, group_col=\"Condition\", title=\"FirstGame \u2212 SecondGame\")\n       .edges(\"FirstGame\", compare=\"SecondGame\", color_scale=\"plot\", magnify=3)\n       .group())\np                              # displays inline in Jupyter\np.export_html(\"rs-data.html\")  # or a self-contained HTML file\n```\n\n![FirstGame \u2212 SecondGame network subtraction of RS.data with both group means](https://gitlab.com/epistemic-analytics/qe-packages/rENA/-/raw/main/python/docs/pyena-rs-subtraction.png)\n\nBlue edges are stronger in FirstGame, red in SecondGame. `magnify=3` widens\nthe edges to make a subtraction's small differences readable (the plot says so).\nSee the [qeviz README](https://qe-libs.org/py/project/qeviz/) for single-group\nnetworks, unit points, and networks or means from your own data.\n\n---\n\n## Accessing Results\n\n```python\nmodel.line_weights_           # normalised adjacency vectors  (n_units \u00d7 n_connections)\nmodel.row_connection_counts_  # row-level raw adjacency vectors (n_rows \u00d7 n_connections)\nmodel.points_                 # unit positions in ENA space   (n_units \u00d7 dims)\nmodel.centroids_              # network centroids             (n_units \u00d7 dims)\nmodel.rotation_nodes_         # code node positions           (n_codes \u00d7 dims)\nmodel.connection_counts_      # raw unit adjacency vectors    (n_units \u00d7 n_connections)\nmodel.unit_labels_            # unit labels in order\nmodel.connection_names_       # e.g. [\"Data & Technical Constraints\", ...]\nmodel.variance_               # variance explained per dimension (= rENA's model$variance)\n```\n\n---\n\n## Separate Accumulation\n\n```python\nfrom pyena import ENA, accumulate\n\naccum = accumulate(rs, \"unit_key\", \"convo_key\", CODES, window_size=4)\n\naccum.connection_counts_      # raw unit co-occurrence matrix\naccum.row_connection_counts_  # raw row co-occurrence matrix\naccum.unit_labels_            # unit labels\naccum.connection_names_       # connection labels\naccum.meta                    # per-unit metadata DataFrame\n\n# Reuse the same accumulation with different rotations\nfrom pyena import mean_rotation, generalized_rotation\n\nmodel_svd = ENA().fit(accum)\nmodel_mr  = ENA().fit(accum, rotation=mean_rotation(g1_mask, g2_mask))\nmodel_gmr = ENA().fit(accum, rotation=generalized_rotation(meta[\"Condition\"]))\n```\n\n---\n\n## Rotation Methods\n\n| Rotation | Argument |\n|---|---|\n| SVD (default) | `rotation=None` |\n| Means | `mean_rotation(g1, g2)` |\n| Generalised (GMR) | `generalized_rotation(x_var)` |\n| Regression (V ~ x) | `regression_rotation(x_var)` |\n| Regression (x ~ V) | `regression_rotation_2(x_var)` |\n| Custom matrix | `rotation=my_ndarray` |\n\n```python\nfrom pyena import ENA, mean_rotation, generalized_rotation, regression_rotation\n\nmeta = (rs.drop_duplicates(\"unit_key\")\n          .set_index(\"unit_key\")\n          .reindex(model.unit_labels_)\n          .reset_index())\n\n# Means rotation\nmodel_mr = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=mean_rotation(\n        meta[\"Condition\"] == \"FirstGame\",\n        meta[\"Condition\"] == \"SecondGame\",\n    )\n)\n\n# Generalised rotation\nmodel_gmr = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=generalized_rotation(meta[\"Condition\"])\n)\n\n# Regression rotation\nimport numpy as np\ncondition_bin = (meta[\"Condition\"] == \"FirstGame\").astype(float).to_numpy()\nmodel_reg = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=regression_rotation(condition_bin)\n)\n```\n\n---\n\n## Window Options\n\n| Option | Argument |\n|---|---|\n| Window back | `window_size=4` |\n| Window forward | `window_forward=2` |\n| Infinite window | `window_size=sys.maxsize` |\n| Binary co-occurrence | `binary=True` |\n| Weighted co-occurrence | `binary=False` |\n\n---\n\n## Further Reading\n\n- [ENA resources page](https://www.epistemicnetwork.org/resources/)\n- [Epistemic Analytics](https://www.epistemicnetwork.org/)",
  "description_content_type": "text/markdown",
  "license": "",
  "name": "pyENA",
  "project_urls": [],
  "requires_dist": [
   "numpy>=1.24",
   "pandas>=1.5",
   "pylibqe>=0.1.3",
   "pytest>=7; extra == 'dev'"
  ],
  "requires_python": ">=3.10",
  "summary": "Python ENA (Epistemic Network Analysis) modeling \u2014 sister package to rENA",
  "version": "0.1.4.9000"
 },
 "dev_metadata_from": "0.1.4.9000",
 "files": {
  "pyena-0.1.0-py3-none-any.whl": {
   "published": null,
   "sha256": "420ce42d81a52b8a2307ce26dd4fb88429c2bff344b7377081aba84ded94eb1f",
   "size": 14027,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/420ce42d81a52b8a2307ce26dd4fb88429c2bff344b7377081aba84ded94eb1f/pyena-0.1.0-py3-none-any.whl",
   "version": "0.1.0"
  },
  "pyena-0.1.0.tar.gz": {
   "published": null,
   "sha256": "da809c0a04c7105088af863b1845d3c080d4c0df501dbf5e20c184182afef945",
   "size": 19891,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/da809c0a04c7105088af863b1845d3c080d4c0df501dbf5e20c184182afef945/pyena-0.1.0.tar.gz",
   "version": "0.1.0"
  },
  "pyena-0.1.1-py3-none-any.whl": {
   "published": null,
   "sha256": "57082758e52ac55ebdd0452ed8404e322faf51f4c784b4bba6fd3c262ef2ec62",
   "size": 14242,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/57082758e52ac55ebdd0452ed8404e322faf51f4c784b4bba6fd3c262ef2ec62/pyena-0.1.1-py3-none-any.whl",
   "version": "0.1.1"
  },
  "pyena-0.1.1.tar.gz": {
   "published": null,
   "sha256": "184072a6f3a3c43f7d9d6ae04ba428d67239758e7c3cfc01d2c18a9b7530f787",
   "size": 20365,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/184072a6f3a3c43f7d9d6ae04ba428d67239758e7c3cfc01d2c18a9b7530f787/pyena-0.1.1.tar.gz",
   "version": "0.1.1"
  },
  "pyena-0.1.2-py3-none-any.whl": {
   "published": null,
   "sha256": "0393dd7cd2763da9eb75d0c51168ba08e85cb8a4cb2936b15df0f8c9b1fd05a1",
   "size": 15710,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/0393dd7cd2763da9eb75d0c51168ba08e85cb8a4cb2936b15df0f8c9b1fd05a1/pyena-0.1.2-py3-none-any.whl",
   "version": "0.1.2"
  },
  "pyena-0.1.2.tar.gz": {
   "published": null,
   "sha256": "4d26427e5b27a614b69641ed26f2cc018b6886d102418417b674677a5d491226",
   "size": 22624,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/4d26427e5b27a614b69641ed26f2cc018b6886d102418417b674677a5d491226/pyena-0.1.2.tar.gz",
   "version": "0.1.2"
  },
  "pyena-0.1.3-py3-none-any.whl": {
   "published": "2026-10-06",
   "sha256": "2df2b3b81594d1b70d6023674c1a8cd57aa7312957746806572c660bdc5daa0a",
   "size": 15822,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/2df2b3b81594d1b70d6023674c1a8cd57aa7312957746806572c660bdc5daa0a/pyena-0.1.3-py3-none-any.whl",
   "version": "0.1.3"
  },
  "pyena-0.1.3.tar.gz": {
   "published": "2026-10-06",
   "sha256": "e35aae1bac7e16ec84e61a046df7a9672e3e298e3cab8aed4c79ca46edf431a1",
   "size": 22921,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/e35aae1bac7e16ec84e61a046df7a9672e3e298e3cab8aed4c79ca46edf431a1/pyena-0.1.3.tar.gz",
   "version": "0.1.3"
  },
  "pyena-0.1.4-py3-none-any.whl": {
   "published": "2026-10-06",
   "sha256": "9c6a6ad7e846c7fc694724c5afb0cce65b5f5ce8027ec4d2f247694552cdafc7",
   "size": 17816,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/9c6a6ad7e846c7fc694724c5afb0cce65b5f5ce8027ec4d2f247694552cdafc7/pyena-0.1.4-py3-none-any.whl",
   "version": "0.1.4"
  },
  "pyena-0.1.4.9000-py3-none-any.whl": {
   "published": "2026-10-06",
   "sha256": "31945d96a1a2958c33bf8ace25737f5f793c88d99eb9a21f6a14e87f007bf50e",
   "size": 17855,
   "version": "0.1.4.9000"
  },
  "pyena-0.1.4.9000.tar.gz": {
   "published": "2026-10-06",
   "sha256": "ca3ecd0e6e4195a75e2408e7c7b43d2895e854b8707cc2ef84b688e4127f687d",
   "size": 23570,
   "version": "0.1.4.9000"
  },
  "pyena-0.1.4.tar.gz": {
   "published": "2026-10-06",
   "sha256": "ef736be5842bd449172b83542cf0ab10188e8d874b33eab5dea4385051574c9b",
   "size": 23566,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/ef736be5842bd449172b83542cf0ab10188e8d874b33eab5dea4385051574c9b/pyena-0.1.4.tar.gz",
   "version": "0.1.4"
  }
 },
 "metadata": {
  "author": "",
  "description": "# pyena\n\nPython implementation of Epistemic Network Analysis (ENA) \u2014 sister package to [`rENA`](../README.md).\n\n`pyena` delegates all core math to [`pylibqe`](https://gitlab.com/epistemic-analytics/qe-packages/libqe),\nthe shared C++ library that also powers rENA.\n\n---\n\n## Installation\n\n`pyena` requires `pylibqe`. Install both from the QE package index:\n\n```bash\npip install pyENA \\\n  --index-url https://qe-libs.org/py/simple/ \\\n  --extra-index-url https://pypi.org/simple/\n```\n\n### Development install\n\n```bash\npip install pylibqe \\\n  --index-url https://qe-libs.org/py/simple/ \\\n  --extra-index-url https://pypi.org/simple/\n\npip install -e \".[dev]\"   # from python/ directory\n```\n\n---\n\n## Quick Start\n\n```python\nimport pandas as pd\nfrom pyena import ENA\n\nrs = pd.read_csv(\"../inst/extdata/rs.data.csv\")   # rENA's RS.data\n\nCODES = [\"Data\", \"Technical Constraints\", \"Performance Parameters\",\n         \"Client and Consultant Requests\", \"Design Reasoning\", \"Collaboration\"]\n\n# Units and conversations as rENA's RS.data examples: units by Condition +\n# UserName, conversations by Condition + GroupName.\nrs[\"unit_key\"]  = rs[\"Condition\"] + \"::\" + rs[\"UserName\"]\nrs[\"convo_key\"] = rs[\"Condition\"] + \"::\" + rs[\"GroupName\"]\n\nmodel = ENA().fit(rs, \"unit_key\", \"convo_key\", CODES, window_size=4)\n```\n\n---\n\n## Plotting\n\npyENA models plot with [qeviz](https://qe-libs.org/py/project/qeviz/), the\ninteractive ENA / ONA network viewer used by rENA (`pip install qeviz\n--index-url https://qe-libs.org/py/simple/`). The two conditions compared \u2014\nFirstGame \u2212 SecondGame, with each group's mean and 95% confidence interval:\n\n```python\nimport qeviz\n\np = (qeviz.from_pyena(model, group_col=\"Condition\", title=\"FirstGame \u2212 SecondGame\")\n       .edges(\"FirstGame\", compare=\"SecondGame\", color_scale=\"plot\", magnify=3)\n       .group())\np                              # displays inline in Jupyter\np.export_html(\"rs-data.html\")  # or a self-contained HTML file\n```\n\n![FirstGame \u2212 SecondGame network subtraction of RS.data with both group means](https://gitlab.com/epistemic-analytics/qe-packages/rENA/-/raw/main/python/docs/pyena-rs-subtraction.png)\n\nBlue edges are stronger in FirstGame, red in SecondGame. `magnify=3` widens\nthe edges to make a subtraction's small differences readable (the plot says so).\nSee the [qeviz README](https://qe-libs.org/py/project/qeviz/) for single-group\nnetworks, unit points, and networks or means from your own data.\n\n---\n\n## Accessing Results\n\n```python\nmodel.line_weights_           # normalised adjacency vectors  (n_units \u00d7 n_connections)\nmodel.row_connection_counts_  # row-level raw adjacency vectors (n_rows \u00d7 n_connections)\nmodel.points_                 # unit positions in ENA space   (n_units \u00d7 dims)\nmodel.centroids_              # network centroids             (n_units \u00d7 dims)\nmodel.rotation_nodes_         # code node positions           (n_codes \u00d7 dims)\nmodel.connection_counts_      # raw unit adjacency vectors    (n_units \u00d7 n_connections)\nmodel.unit_labels_            # unit labels in order\nmodel.connection_names_       # e.g. [\"Data & Technical Constraints\", ...]\nmodel.variance_               # variance explained per dimension (= rENA's model$variance)\n```\n\n---\n\n## Separate Accumulation\n\n```python\nfrom pyena import ENA, accumulate\n\naccum = accumulate(rs, \"unit_key\", \"convo_key\", CODES, window_size=4)\n\naccum.connection_counts_      # raw unit co-occurrence matrix\naccum.row_connection_counts_  # raw row co-occurrence matrix\naccum.unit_labels_            # unit labels\naccum.connection_names_       # connection labels\naccum.meta                    # per-unit metadata DataFrame\n\n# Reuse the same accumulation with different rotations\nfrom pyena import mean_rotation, generalized_rotation\n\nmodel_svd = ENA().fit(accum)\nmodel_mr  = ENA().fit(accum, rotation=mean_rotation(g1_mask, g2_mask))\nmodel_gmr = ENA().fit(accum, rotation=generalized_rotation(meta[\"Condition\"]))\n```\n\n---\n\n## Rotation Methods\n\n| Rotation | Argument |\n|---|---|\n| SVD (default) | `rotation=None` |\n| Means | `mean_rotation(g1, g2)` |\n| Generalised (GMR) | `generalized_rotation(x_var)` |\n| Regression (V ~ x) | `regression_rotation(x_var)` |\n| Regression (x ~ V) | `regression_rotation_2(x_var)` |\n| Custom matrix | `rotation=my_ndarray` |\n\n```python\nfrom pyena import ENA, mean_rotation, generalized_rotation, regression_rotation\n\nmeta = (rs.drop_duplicates(\"unit_key\")\n          .set_index(\"unit_key\")\n          .reindex(model.unit_labels_)\n          .reset_index())\n\n# Means rotation\nmodel_mr = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=mean_rotation(\n        meta[\"Condition\"] == \"FirstGame\",\n        meta[\"Condition\"] == \"SecondGame\",\n    )\n)\n\n# Generalised rotation\nmodel_gmr = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=generalized_rotation(meta[\"Condition\"])\n)\n\n# Regression rotation\nimport numpy as np\ncondition_bin = (meta[\"Condition\"] == \"FirstGame\").astype(float).to_numpy()\nmodel_reg = ENA().accumulate(rs, \"unit_key\", \"convo_key\", CODES).fit(\n    rotation=regression_rotation(condition_bin)\n)\n```\n\n---\n\n## Window Options\n\n| Option | Argument |\n|---|---|\n| Window back | `window_size=4` |\n| Window forward | `window_forward=2` |\n| Infinite window | `window_size=sys.maxsize` |\n| Binary co-occurrence | `binary=True` |\n| Weighted co-occurrence | `binary=False` |\n\n---\n\n## Further Reading\n\n- [ENA resources page](https://www.epistemicnetwork.org/resources/)\n- [Epistemic Analytics](https://www.epistemicnetwork.org/)",
  "description_content_type": "text/markdown",
  "license": "",
  "name": "pyENA",
  "project_urls": [],
  "requires_dist": [
   "numpy>=1.24",
   "pandas>=1.5",
   "pylibqe>=0.1.3",
   "pytest>=7; extra == 'dev'"
  ],
  "requires_python": ">=3.10",
  "summary": "Python ENA (Epistemic Network Analysis) modeling \u2014 sister package to rENA",
  "version": "0.1.4"
 },
 "metadata_from": "0.1.4",
 "name": "pyena"
}
