Skip to content

Commit

Permalink
Merge pull request #123 from brian-team/setuptools
Browse files Browse the repository at this point in the history
Setuptools
  • Loading branch information
thesamovar committed Sep 19, 2013
2 parents 3e6f519 + d75ca8b commit ac71ad0
Show file tree
Hide file tree
Showing 10 changed files with 464 additions and 70 deletions.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include docs_spinx *.rst
prune docs_sphinx/references

11 changes: 0 additions & 11 deletions README.md

This file was deleted.

20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Brian2
======

*A clock-driven simulator for spiking neural networks*

Brian2 is currently under development and meant to replace Brian, the spiking
neural network simulator, in the long term. At the moment, please use a recent
release of Brian for actual simulations: http://briansimulator.org

Testing status for master branch
--------------------------------

.. image:: https://travis-ci.org/brian-team/brian2.png?branch=master
:target: https://travis-ci.org/brian-team/brian2?branch=master

.. image:: https://coveralls.io/repos/brian-team/brian2/badge.png?branch=master
:target: https://coveralls.io/r/brian-team/brian2?branch=master



3 changes: 1 addition & 2 deletions brian2/codegen/runtime/numpy_rt/numpy_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class NumpyCodeObject(CodeObject):
Default for Brian because it works on all platforms.
'''
templater = Templater(os.path.join(os.path.split(__file__)[0],
'templates'))
templater = Templater('brian2.codegen.runtime.numpy_rt')
language = NumpyLanguage()
class_name = 'numpy'

Expand Down
3 changes: 1 addition & 2 deletions brian2/codegen/runtime/weave_rt/weave_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ class WeaveCodeObject(CodeObject):
object with two macros defined, ``main`` (for the main loop code) and
``support_code`` for any support code (e.g. function definitions).
'''
templater = Templater(os.path.join(os.path.split(__file__)[0],
'templates'))
templater = Templater('brian2.codegen.runtime.weave_rt')
language = CPPLanguage(c_data_type=weave_data_type)
class_name = 'weave'

Expand Down
12 changes: 3 additions & 9 deletions brian2/codegen/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
from brian2.utils.stringtools import (indent, deindent, strip_empty_lines,
get_identifiers)
from jinja2 import Template, Environment, FileSystemLoader
from jinja2 import Template, Environment, FileSystemLoader, PackageLoader
import os
import re

Expand All @@ -13,9 +13,8 @@ class Templater(object):
'''
Class to load and return all the templates a `CodeObject` defines.
'''
def __init__(self, basedir, env_globals=None):
self.basedir = basedir
self.env = Environment(loader=FileSystemLoader(basedir),
def __init__(self, package_name, env_globals=None):
self.env = Environment(loader=PackageLoader(package_name, 'templates'),
trim_blocks=True,
lstrip_blocks=True,
)
Expand Down Expand Up @@ -80,8 +79,3 @@ def __str__(self):
return s

__repr__ = __str__


if __name__=='__main__':
lt = Templater('runtime/numpy_rt/templates')
print lt.reset(['a=b', 'c=d'])
3 changes: 1 addition & 2 deletions brian2/devices/cpp_standalone/codeobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class CPPStandaloneCodeObject(CodeObject):
object with two macros defined, ``main`` (for the main loop code) and
``support_code`` for any support code (e.g. function definitions).
'''
templater = Templater(os.path.join(os.path.split(__file__)[0],
'templates'))
templater = Templater('brian2.devices.cpp_standalone')
language = CPPLanguage()

def variables_to_namespace(self):
Expand Down
Loading

0 comments on commit ac71ad0

Please sign in to comment.