threadlepy 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {threadlepy-0.1.3 → threadlepy-0.1.4}/CHANGELOG.md +4 -0
  2. {threadlepy-0.1.3/src/threadlepy.egg-info → threadlepy-0.1.4}/PKG-INFO +1 -1
  3. {threadlepy-0.1.3 → threadlepy-0.1.4}/pyproject.toml +1 -1
  4. {threadlepy-0.1.3 → threadlepy-0.1.4}/scripts/test_all_commands_example_data.py +19 -0
  5. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/__init__.py +1 -1
  6. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/commands.py +9 -2
  7. {threadlepy-0.1.3 → threadlepy-0.1.4/src/threadlepy.egg-info}/PKG-INFO +1 -1
  8. {threadlepy-0.1.3 → threadlepy-0.1.4}/LICENSE +0 -0
  9. {threadlepy-0.1.3 → threadlepy-0.1.4}/MANIFEST.in +0 -0
  10. {threadlepy-0.1.3 → threadlepy-0.1.4}/README.md +0 -0
  11. {threadlepy-0.1.3 → threadlepy-0.1.4}/docs/threadlepy_tutorial.ipynb +0 -0
  12. {threadlepy-0.1.3 → threadlepy-0.1.4}/scripts/test_commands.py +0 -0
  13. {threadlepy-0.1.3 → threadlepy-0.1.4}/scripts/test_session.py +0 -0
  14. {threadlepy-0.1.3 → threadlepy-0.1.4}/setup.cfg +0 -0
  15. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/Scripts/create.txt +0 -0
  16. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/dscw.tsv +0 -0
  17. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/dscw_nodeset.tsv +0 -0
  18. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/lazega.tsv +0 -0
  19. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/lazega_female.tsv +0 -0
  20. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/lazega_female_nodeset.tsv +0 -0
  21. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/lazega_nodes.tsv +0 -0
  22. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/mynet.tsv +0 -0
  23. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/mynet_nodesetfile.tsv +0 -0
  24. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/Examples/mynodes.tsv +0 -0
  25. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/client.py +0 -0
  26. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy/py.typed +0 -0
  27. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy.egg-info/SOURCES.txt +0 -0
  28. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy.egg-info/dependency_links.txt +0 -0
  29. {threadlepy-0.1.3 → threadlepy-0.1.4}/src/threadlepy.egg-info/top_level.txt +0 -0
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4
4
+
5
+ - Added the `return_histograms` option to `rwfpt()` / `th_rwfpt()` to match the current threadleR wrapper.
6
+
3
7
  ## 0.1.3
4
8
 
5
9
  - Aligned `load_examples()` with threadleR behavior by assigning example handles by default and restoring the previous Threadle working directory after loading.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threadlepy
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Python client for the Threadle CLI JSON interface.
5
5
  Author: Yukun Jiao
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "threadlepy"
7
- version = "0.1.3"
7
+ version = "0.1.4"
8
8
  description = "Python client for the Threadle CLI JSON interface."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -253,6 +253,25 @@ def run(threadle_path: str | None = None, *, timeout: float = 1800.0) -> int:
253
253
  )
254
254
  show("info rw distances", lambda: th.info(rw_distances))
255
255
  show("info rw fpt", lambda: th.info(rw_fpt))
256
+ rw_fpt_hist = show(
257
+ "rw fpt with histograms",
258
+ lambda: th.rwfpt(
259
+ "rw_fpt_hist",
260
+ walk_net,
261
+ attrname="group",
262
+ maxsteps=30,
263
+ layernames="walk_layer",
264
+ walkfactor=0.5,
265
+ minpairobs=1,
266
+ balanced=False,
267
+ weighted=False,
268
+ return_histograms=True,
269
+ ),
270
+ )
271
+ show(
272
+ "info rw fpt histogram network",
273
+ lambda: th.info(rw_fpt_hist["network"] if isinstance(rw_fpt_hist, dict) else rw_fpt_hist),
274
+ )
256
275
 
257
276
  # Miscellaneous session helpers.
258
277
  show("setting verbose false", lambda: th.setting("verbose", False))
@@ -2,7 +2,7 @@
2
2
 
3
3
  from .client import ThreadleStruct, configure, is_available, raw_cmd, session, start, stop
4
4
 
5
- __version__ = "0.1.3"
5
+ __version__ = "0.1.4"
6
6
 
7
7
  __all__ = [
8
8
  "ThreadleStruct",
@@ -735,14 +735,21 @@ def rwfpt(
735
735
  minpairobs: int = 10,
736
736
  balanced: bool = False,
737
737
  weighted: bool = False,
738
+ return_histograms: bool = False,
738
739
  layername: Optional[Union[str, list[str], tuple[str, ...]]] = None,
739
740
  ):
740
741
  """Estimate category mean first-passage times with random walks and return a result network handle."""
741
742
  if layername is not None and not layernames:
742
743
  layernames = layername
743
744
  layernames = _collapse(layernames)
744
- call("rwfpt", locals(), assign=name, drop=("layername",))
745
- return _handle(name)
745
+ args = locals().copy()
746
+ if return_histograms:
747
+ args["returnhistograms"] = "true"
748
+ payload = call("rwfpt", args, assign=name, drop=("layername", "return_histograms"))
749
+ network_handle = _handle(name)
750
+ if return_histograms and payload is not None:
751
+ return {"network": network_handle, "histograms": payload}
752
+ return network_handle
746
753
 
747
754
 
748
755
  def random_seed(seed: int = 6031769):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: threadlepy
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Python client for the Threadle CLI JSON interface.
5
5
  Author: Yukun Jiao
6
6
  License-Expression: MIT
File without changes
File without changes
File without changes
File without changes