}

branches = {'NeuroML2': 'development'}

all_repos.update(additional_repos)

projects = len(all_repos.keys())

if __name__ == "__main__":
    start = datetime.datetime.now()

    project_num = 1000
    if len(sys.argv) == 2:
        project_num = int(sys.argv[1])

    for project in osb.get_projects(min_curation_level="Low",
                                    limit=project_num):

        print("\n%sPre checking OSB project: %s (%s)\n" %
              ("-" * 8, project.name, project.identifier))

        if project.identifier not in ignores:

            github_repo = project.github_repo

            projects += 1

            if github_repo is not None:

                if github_repo.check_file_in_repository(".travis.yml"):

                    raw_url = github_repo.link_to_raw_file_in_repo(
Ejemplo n.º 2
0
'''
Script to check ModelDB references
'''


import osb

projects = 0
with_modeldb = 0
    
for project in osb.get_projects(min_curation_level="None"):

    if project.is_standard_project():
        
        print "\n--------   Project: %s\n" % project.name
        projects+=1

        if project.modeldb_reference:
            print "    OSB link:%shttp://opensourcebrain.org/projects/%s" % (" "*22, project.identifier)
            print("    ModelDB link:%shttp://senselab.med.yale.edu/ModelDB/ShowModel.asp?model=%s" % (' '*18, project.modeldb_reference))
            with_modeldb +=1
        else:
            print "    No ModelDB info for model"
    

print("\nThere were %i projects, %i of which had ModelDB information\n"%(projects, with_modeldb))
        
projects = len(all_repos.keys())

bad_projects_found = {}

if __name__ == "__main__":
    start = datetime.datetime.now()

    project_num = 1000
    if len(sys.argv) == 2:
        try:
            project_num = int(sys.argv[1])
        except:
            print("ignoring...")

    all_projs = osb.get_projects(min_curation_level="None", limit=project_num)

    for project in all_projs:

        print("\n%sPre checking OSB project: %s (%s)\n" %
              ("-" * 8, project.name, project.identifier))

        if project.identifier not in ignores:

            github_repo = project.github_repo

            projects += 1

            if github_repo is not None:

                if github_repo.check_file_in_repository(".travis.yml"):
'''
Script to check ModelDB references
'''

# From https://github.com/OpenSourceBrain/OSB_API/tree/master/python
import osb

projects = 0
with_modeldb = 0

for project in osb.get_projects(min_curation_level="None"):

    if project.is_standard_project():

        print "\n--------   Project: %s\n" % project.name
        projects += 1

        if project.modeldb_reference:
            print "    OSB link:%shttp://opensourcebrain.org/projects/%s" % (
                " " * 22, project.identifier)
            print(
                "    ModelDB link:%shttp://senselab.med.yale.edu/ModelDB/ShowModel.asp?model=%s"
                % (' ' * 18, project.modeldb_reference))
            with_modeldb += 1
        else:
            print "    No ModelDB info for model"

print("\nThere were %i projects, %i of which had ModelDB information\n" %
      (projects, with_modeldb))
Ejemplo n.º 5
0
'''
Script to check ModelDB references
'''


import osb
import operator

projects = 0
with_tags = 0
tags = {}
    
for project in osb.get_projects(min_curation_level="Low"):

    if project.is_standard_project() or project.is_showcase():
        
        print "\n--------   Project: %s\n" % project.name
        projects+=1

        if project.tags:
            print "    Project has tags: %s" % (project.tags)
            with_tags +=1
            for tag in project.tags:
                if not tags.has_key(tag):
                    tags[tag] = 0
                tags[tag] +=1
    

print("\nThere were %i projects, %i of which had tags\n"%(projects, with_tags))
sorted_tags = sorted(tags.iteritems(), key=operator.itemgetter(1), reverse=True)
for s in sorted_tags:
Ejemplo n.º 6
0
        print("Only looking for NeuroML v1 files")
        versionFolder = "NeuroML"
        nml_schema_file = urlopen("http://www.neuroml.org/NeuroMLValidator/NeuroMLFiles/Schemata/v1.8.1/Level3/NeuroML_Level3_v1.8.1.xsd")
        nml_suffix = ".xml"
        nml2 = False

    if len(sys.argv) == 2 and sys.argv[1]=='-local':
        local = True

    if local: print("Only checking local NeuroML files")


    xmlschema_doc = etree.parse(nml_schema_file)
    xmlschema = etree.XMLSchema(xmlschema_doc)

    for project in osb.get_projects(min_curation_level="None", limit=project_num):
        
        print("\n--------   Project: "+ project.name +" ("+ project.identifier +")"+ "\n")

        ignores = ['blender-to-neuroml', 
                   'olfactory-bulb-network-model-o-connor-angelo-and-jacob-2012',
                   'neurosciences-repository']
        
        if project_num<30:
                   ignores += ['miglioreetal14_olfactorybulb3d', # Lots of NML2... 
                   'alleninstituteneuroml', # Lots of NML2... 
                   'blue-brain-project-showcase', # Lots of NML2... 
                   'ca1-pv-fast-firing-cell-ferguson-et-al-2013']

        if not ( project.is_standard_project() or project.is_showcase()):
            print("  (Ignoring project as its category is: %s)  "%project.category)
projects = len(all_repos.keys())

bad_projects_found = {}

if __name__ == "__main__":
    start = datetime.datetime.now()

    project_num = 1000
    if len(sys.argv) == 2:
        try:
            project_num = int(sys.argv[1])
        except:
            print("ignoring...")
            
    all_projs = osb.get_projects(min_curation_level="None",
                                    limit=project_num)
            
    for project in all_projs:

        print("\n%sPre checking OSB project: %s (%s)\n" %
              ("-" * 8, project.name, project.identifier))
        
        if project.identifier not in ignores:

            github_repo = project.github_repo

            projects += 1

            if github_repo is not None:
                
                if github_repo.check_file_in_repository(".travis.yml"):
Ejemplo n.º 8
0
if __name__ == "__main__":
    
    project_num = 1000
    if len(sys.argv) >= 2:
        project_num = int(sys.argv[1])
        
    url = 'http://www.opensourcebrain.org/projects.json'
    
    if '-comodl' in sys.argv:
        url = 'http://www.comodl.org/projects.json'
    if '-local' in sys.argv:
        url = 'http://localhost:3000/projects.json'
        

    for project in osb.get_projects(min_curation_level="Low", limit=project_num, url=url, verbose=True):

        print("\n%sProject: %s (%s)\n" % ("-"*8,project.name,project.identifier))

        github_repo = project.github_repo

        if project.is_standard_project() or project.is_showcase():
            projects +=1
            passed = 1

            if project.status == None:
                print("  No status!")
                passed = 0

            if project.is_standard_project():
                if project.spine_classification == None:
Ejemplo n.º 9
0
# Installed packages.  
import neuroml.loaders as loaders
import osb
import sciunit
from neuronunit import neuroelectro,tests,capabilities
from neuronunit.neuroconstruct import models

def qprint(string):
	if not QUIET:
		print(string)

ephys_property = "Resting Membrane Potential"  
nml2_model_list = os.listdir(NEUROML2_PATH)

# Get projects with medium curation level. 
osb_projects = osb.get_projects('Medium')  

for model_name in nml2_model_list:
	print(model_name)
	path = os.path.join(NEUROML2_PATH,model_name)
	nml_files = glob.glob(path+"/*.nml")
	if not len(nml_files):
		qprint("No .nml files found for model %s" % model_name)
	for nml_file in nml_files:
		nml = loaders.NeuroMLLoader.load(nml_file)
		for cell in nml.cells:
			nlex_id = cell.neuro_lex_id
			if nlex_id is None:
				project = osb.get_project_with_identifier(model_name,osb_projects)
				if project:
					nlex_id_list = project.NEUROLEX_IDS_CELLS
Ejemplo n.º 10
0
import osb
import sciunit
from neuronunit import neuroelectro, tests, capabilities
from neuronunit.neuroconstruct import models


def qprint(string):
    if not QUIET:
        print(string)


ephys_property = "Resting Membrane Potential"
nml2_model_list = os.listdir(NEUROML2_PATH)

# Get projects with medium curation level.
osb_projects = osb.get_projects('Medium')

for model_name in nml2_model_list:
    print(model_name)
    path = os.path.join(NEUROML2_PATH, model_name)
    nml_files = glob.glob(path + "/*.nml")
    if not len(nml_files):
        qprint("No .nml files found for model %s" % model_name)
    for nml_file in nml_files:
        nml = loaders.NeuroMLLoader.load(nml_file)
        for cell in nml.cells:
            nlex_id = cell.neuro_lex_id
            if nlex_id is None:
                project = osb.get_project_with_identifier(
                    model_name, osb_projects)
                if project:
Ejemplo n.º 11
0
NEUROML2_PATH = "/Users/rgerkin/NeuroML2" # Path to NeuroML2 compliant OSB models.  

# Standard library.  
import os

# Installed packages.  
import sciunit
from neuronunit import neuroelectro,tests,capabilities
from neuronunit.neuroconstruct import models
import osb

osb_projects = osb.get_projects(1)

# Initialize the test with summary statistics from the reference data
# and arguments for the model (model).  

from pythonnC.utils.putils import OSB_MODELS
brain_areas = os.listdir(OSB_MODELS)
models_tested = 0
nlex_ids = {}
for brain_area in brain_areas:
	path = os.path.join(OSB_MODELS,brain_area)
	if not os.path.isdir(path):
		continue
	neuron_types = os.listdir(path)
	for neuron_type in neuron_types:
		path = os.path.join(OSB_MODELS,brain_area,neuron_type)
		if not os.path.isdir(path):
			continue
		model_names = os.listdir(path)
		for model_name in model_names: