Comments (2)
Still don't know how to solve this in the best way. This is what I've been imagining:
Ideally, the user could do
import neurolib
print(neurolib.models)
and get a list of the model's module names (e.g., neurolib.models.aln
), and the name and the description attribute of each model.
This gets the name of all submodules for example (in neurolib/__init__py
). But then? Do I need to import them to get the attributes of each model class? Seems a bit overkill.
import pkgutil
import neurolib.models
package = neurolib.models
models = []
for _, modname, _ in pkgutil.walk_packages(
path=package.__path__, prefix=package.__name__ + ".", onerror=lambda x: None
):
if modname.split(".")[-1] == "model":
models.append(modname)
Obviously the easiest way would be to hardcode a list. But that's not fun, innit?
from neurolib.
I think you actually need to import them in order to get the info stored in the class itself... so some packages define something like __all__ = []
as a list in some __init__
file which also then can work like "from neurolib.models import *" and it'll import only stuff that is inside __all__
...
that can be also used to print out available models I guess?
however, print(neurolib.models)
won't work I am afraid..
from neurolib.
Related Issues (20)
- Citation HOT 1
- Better error catching in exploration
- There are 0 valid individuals Mean score across population: nan HOT 7
- If set explicitly, local connectivity weights for ALNNode change after running the model HOT 3
- Try to make MultiModel faster HOT 1
- Neurolib satellite tutorial session at CNS*2022 HOT 20
- Testing: test_models with dynamic loading HOT 1
- TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class HOT 3
- Help Using Neurolib: Finding an easy way to load new data for the model implementation HOT 1
- Question about the animation HOT 1
- Parameter exploration bug: PicklingError HOT 5
- Cmat is the same in two model instances, but models themselves are not HOT 1
- WW model is missing in example and test
- Documentation pipeline fails HOT 1
- model parameters and stimulation
- Parameters provided in examples (and default parameters) does not perform BOLD simulation correctly HOT 1
- Possible deprecation issues in the example file of multimodel_custom_model HOT 1
- Example files appear to be broken
- how to use EEG data with neurolib?
- Wong Wang working example to produce FCD matrix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neurolib.