-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changes API and adds some general code improvements (#166) * renames number_of_processes to n_jobs (fixes #103) * exposes make_data_array as ndl.data_array(...) and adds tests (fixes #122) * adds learning events from generators in ndl.ndl (fixes #165) * changes tuples into namedtuples for return values (fixes #108) * adds sanity check for too many cues or outcomes (see #169 for details). * gets rid of DeprecationWarning * checks if outcomes_vectors, cue_vectors and weights are c_contiguous before passing it to cython functions (fixes #192) * adds conditional imports to support python 3.7 for the time being * merges develop and deletes it afterwards (fixes #193) Co-authored-by: Marc Weitz <[email protected]>
- Loading branch information
Showing
15 changed files
with
275 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,27 @@ | |
import os | ||
import sys | ||
import multiprocessing as mp | ||
from pip._vendor import pkg_resources | ||
try: | ||
from importlib.metadata import requires | ||
except ModuleNotFoundError: # python 3.7 and before | ||
requires = None | ||
try: | ||
from packaging.requirements import Requirement | ||
except ModuleNotFoundError: # this should only happend during setup phase | ||
Requirement = None | ||
|
||
|
||
__author__ = ('Konstantin Sering, Marc Weitz, ' | ||
'David-Elias Künstle, Lennard Schneider, ' | ||
'Elnaz Shafaei-Bajestan') | ||
__author_email__ = '[email protected]' | ||
__version__ = '0.8.2' | ||
__version__ = '0.8.1' | ||
__license__ = 'MIT' | ||
__description__ = ('Naive discriminative learning implements learning and ' | ||
'classification models based on the Rescorla-Wagner ' | ||
'equations.') | ||
__classifiers__ = [ | ||
'Development Status :: 3 - Alpha', | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Console', | ||
'Intended Audience :: Science/Research', | ||
'License :: OSI Approved :: MIT License', | ||
|
@@ -45,8 +52,9 @@ def sysinfo(): | |
""" | ||
Prints system the dependency information | ||
""" | ||
pyndl = pkg_resources.working_set.by_key["pyndl"] | ||
dependencies = [r.project_name for r in pyndl.requires()] | ||
if requires: | ||
dependencies = [Requirement(req).name for req in requires('pyndl') | ||
if not Requirement(req).marker] | ||
|
||
header = ("Pyndl Information\n" | ||
"=================\n\n") | ||
|
@@ -78,7 +86,10 @@ def sysinfo(): | |
deps = ("Dependencies\n" | ||
"------------\n") | ||
|
||
deps += "\n".join("{pkg.__name__}: {pkg.__version__}".format(pkg=__import__(dep)) | ||
for dep in dependencies) | ||
if requires: | ||
deps += "\n".join("{pkg.__name__}: {pkg.__version__}".format(pkg=__import__(dep)) | ||
for dep in dependencies) | ||
else: | ||
deps = 'You need Python 3.8 or higher to show dependencies.' | ||
|
||
print(header + general + osinfo + deps) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.