{"id":13689391,"url":"https://github.com/mb-BCA/NetDynFlow","last_synced_at":"2025-05-01T23:34:13.945Z","repository":{"id":53977436,"uuid":"196256458","full_name":"mb-BCA/NetDynFlow","owner":"mb-BCA","description":"A package to study complex networks based on the temporal evolution of their Dynamic Communicability and Flow.","archived":false,"fork":false,"pushed_at":"2024-07-23T07:23:48.000Z","size":3419,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T15:17:46.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mb-BCA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-10T18:30:53.000Z","updated_at":"2024-07-23T07:23:52.000Z","dependencies_parsed_at":"2024-03-14T17:59:43.864Z","dependency_job_id":null,"html_url":"https://github.com/mb-BCA/NetDynFlow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mb-BCA%2FNetDynFlow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mb-BCA%2FNetDynFlow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mb-BCA%2FNetDynFlow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mb-BCA%2FNetDynFlow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mb-BCA","download_url":"https://codeload.github.com/mb-BCA/NetDynFlow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224282259,"owners_count":17285796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T15:01:45.827Z","updated_at":"2024-11-12T13:31:37.858Z","avatar_url":"https://github.com/mb-BCA.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\n# NetDynFlow\n\nA package to study complex networks based on the temporal evolution of their Dynamic Communicability and Flow.\n\nGraph theory constitutes a widely used and established field providing powerful tools for the characterization of complex networks. However, the diversity of complex networks studied nowadays overcomes the capabilities of classical graph metrics (originally developed for binary adjacency matrices) to provide with information to understand networks and their function. Also, in several domains, networks are often inferred from real-data-forming dynamic systems and thus, their analysis requires a different angle. The tools given in this package allow to overcome those limitations for a variety of complex networks, specially those that are weighted and whose structure is associated with dynamical phenomena.\n\n*Dynamic Flow* characterises the transient network response over time, as the network dynamics relax towards their resting-state after a pulse perturbation (either independent or correlated Gaussian noise) has been applied to selected nodes. On the other hand, *Dynamic Communicability* corresponds to the special case where uncorrelated Gaussian noise has initially been applied to all nodes. The behaviour of the interactions during this transition allows to uncover properties of networks and their function. From a computational point of view dynamic communicability and flow are characterised by a series of matrices, encoding the temporal evolution of the pair-wise interactions between nodes.\n\n\n#### Reference and Citation\n\n* M. Gilson, N. Kouvaris, G. Deco and G. Zamora-Lopez \"*[Framework based on communicability and flow to analyze complex networks](https://journals.aps.org/pre/abstract/10.1103/PhysRevE.97.052301)*\" Phys. Rev. E **97**, 052301 (2018).\n* M. Gilson, N. Kouvaris, et al. \"*[Network analysis of whole-brain fMRI\ndynamics: A new framework based on dynamic communicability](https://doi.org/10.1016/j.neuroimage.2019.116007)*\" NeuroImage **201**, 116007 (2019).\n\n\n\n### INSTALLATION\n\nInstallation of *NetDynFlow* is simple. An existing python distribution and the [pip](https://github.com/pypa/pip) package manager need to be installed. If Python was installed via the [Canopy](https://www.enthought.com/product/canopy/) or the [Anaconda](https://www.anaconda.com) distributions, then pip is surely installed. To check, open a terminal and type:\n\n\t$ pip --help\n\n*NetDynFlow* is still not registered in PyPI (the Python Packages Index) and installation follows directly from GitHub. However, pip will automatically take care of the  dependencies (see the *requirements.txt* file). There are two alternative manners to install: the easy and the lazy. \n\n**- The easy installation**: Visit the GitHub repository [https://github.com/gorkazl/NetDynFlow/](https://github.com/gorkazl/NetDynFlow/) and click on the \"Clone or download\" button at the right hand side (the green button). Select \"Download ZIP\". Unzip the file, open a terminal and move to the folder, e.g.,\n\n\t$ cd ~/Downloads/NetDynFlow-master/\n\nOnce on the folder that contains the *setup.py* file, type the following\n\n\t$ pip install .\n\nDo not forget the \".\" at the end which means \"*look for the setup.py file in the current directory*.\" This will check for the dependencies and install *NetDynFlow*. To confirm the installation open an interactive session and try to import the library by typing `import netdynflow`.\n\n\u003e **NOTE**: After installation the current folder \"*~/Downloads/NetDynFlow-master/*\" can be safely deleted, or moved somewhere else if you want to conserve the examples and the tests.\n\n**- The lazy installation**: If [git](https://git-scm.com) is also installed in your computer, then open a terminal and type:\n\n\t$ pip install git+https://github.com/mb-BCA/NetDynFlow.git@master\n\nThis will install the package, that is, the content in the folder *netdynflow/*. Other files (Examples/, README.md, LICENSE.txt, etc.) need to be downloaded manually, if wanted.\n\n\n\n### HOW TO USE *NetDynFlow*\n\nThe package is organised into two modules:\n\n- *core.py*: Functions to obtain the temporal evolution of dynamic communicability and flow.\n- *metrics.py*: Network descriptors to analyse the temporal evolution of the dynamic communicability and flow.\n\nTo see the list of all functions available use the standard help in an interactive session, e.g.,\n\n\t\u003e\u003e\u003e import netdynflow as ndf\n\t\u003e\u003e\u003e ndf.core?\n\t\u003e\u003e\u003e ndf.metrics?\n\n\u003e**NOTE:** Importing *NetDynflow* brings all functions in the two modules into its local namespace. Thus, functions in each of the two modules are called as `ndf.func()` instead of `ndf.core.func()` or `ndf.metrics.func()`. Details of each function is also found using the usual help, e.g.,\n\n\t\u003e\u003e\u003e ndf.DynCom?\n\t\u003e\u003e\u003e ndf.Diversity?\n\n\n#### Getting started \nCreate a simple weighted network of N = 4 nodes (a numpy array) and compute its dynamic communicability over time:\n\n\t\u003e\u003e\u003e net = np.array((\t(0, 1.2, 0, 0),\n\t\t\t\t\t\t\t(0, 0, 1.1, 0),\n\t\t\t\t\t\t\t(0, 0, 0, 0.7),\n\t\t\t\t\t\t\t(1.0, 0, 0, 0)), float)\n\t\u003e\u003e\u003e tau = 0.8\n\t\u003e\u003e\u003e dyncom = ndf.DynCom(net, tau, tmax=15, timestep=0.01)\n\nThe resulting variable `dyncom` is an array of rank-3 with dimensions ((tmax x tstep) x N x N) containing tmax / tstep = 1500 matrices of size 4 x 4, each describing the state of the network at a given time step. \n\n\u003e **NOTE**: *NetDynFlow* employs the convention in graph theory that rows of the connectivity matrix encode the outputs of the node. That is, `net[i,j] = 1` implies that the node in row `i` projects over the node in column `j`.\n\nNow we calculate the *total communicability* and *diversity* of the network over time as:\n\n\t\u003e\u003e\u003e totalcom = ndf.TotalEvolution(dyncom)\n\t\u003e\u003e\u003e divers = ndf.Diversity(dyncom)\n\n`totalcom` and `divers` are two numpy arrays of length (tmax / tsteps) = 1500.\n\n\n### LICENSE\n\nCopyright 2019, Gorka Zamora-López, Matthieu Gilson and Nikos E. Kouvaris. E-mail: \u003cgorka@Zamora-Lopez.xyz\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this software except in compliance with the License.\nYou may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n-------------------------------------------------------------------------------\n### VERSION HISTORY\n\n##### March 14, 2024\nSmall bugs fixed:\n\n- Remaining *Numba* dependency removed.\n- Fixed the new  aliases for `int` and `float` in *Numpy*. All arrays are now declared as `np.int64` or `np.float64`, and individual numbers as standard Python `int` or `float`. \n\n##### December 14, 2023\n*core.py* module has been simplified to three practical functions `DynFlow()`, `IntrinsicFlow()` and `ExtrinsicFlow()`. \n\nNew measures added to *metrics.py* module: `Time2Peak()`, `Time2Decay` and `AreaUnderCurve()`. These functions accept either the temporal response matrices of shape (nt,N,N) (e.g., the output of DynFlow), the temporal responses of nodes of shape (nt,N) or the global network response of shape (nt,1). The functions will return a matrix, a vector or an scalar accordingly for each case.\n\n##### November 20, 2019\nOfficial **version 1.0.0** has been uploaded. \nThe package went through an in-depth internal revision but implies minor changes from the user point of view.\n\n1. Function `CalcTensor()` was created, which makes most of the dirty job while the rest of core functions, e.g., `DynCom()` or `DynFlow()` became wrappers calling `CalcTensor()`. This internal redesign was made to avoid reproducing code in several parts and thus simplify maintenance.\n2. Some internal variables were remaned for uniformity with the [pyMOU](https://github.com/mb-BCA/pyMOU) package.\n3. An examples folder was added to host tutorials (Jupyter Notebooks). These examples will be further updated but version of the package will remain v1.0.0 until changes are done at the core files.\n\n##### July 10, 2019\nFirst release of *NetDynFlow* (Beta).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmb-BCA%2FNetDynFlow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmb-BCA%2FNetDynFlow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmb-BCA%2FNetDynFlow/lists"}