コード例 #1
0
from core.microtubule import Microtubule

from core.files import Files
from core.events import Events


def build(files):
    config = files.get_config()

    # создание микротрубочки
    mt = Microtubule(columns=int(config['mt']['protofilaments']),
                     timer=float(config['time']['timer']),
                     fps=float(config['time']['fps']),
                     events=Events(config),
                     mode='window',
                     window=5)

    mt.build()


if __name__ == "__main__":
    files = Files('flat')
    files.get_config()

    # build and generate output
    build(files)
    #files.make_csv(build(files))

#print("Выполнено за {} секунд".format((stop - start)))
コード例 #2
0
ファイル: gmpcpp.py プロジェクト: cheremushkin/microtubule
import plotly.plotly as py
import plotly.graph_objs as go

py.sign_in('cheremushkin', 'fsdjBUr906AXZS6CsKmT')


# edit Events parameter for this calibration
def dissociation(self, x, y, hydrolysed):
    return -np.log(np.random.random()) / float(
        self.config['general']['koff']), 'dissociation', x, y


Events.dissociation = dissociation

if __name__ == "__main__":
    files = Files('gmpcpp')
    config = files.get_config()

    # get config data
    lateral_start = float(config['calibration']['lat-start'])
    lateral_end = float(config['calibration']['lat-end'])
    lateral_steps = int(config['calibration']['lat-steps'])
    koff_start = float(config['calibration']['koff-start'])
    koff_end = float(config['calibration']['koff-end'])
    koff_steps = int(config['calibration']['koff-steps'])

    # remove config data
    config.remove_section('calibration')
    files.change_config(config)
    files.create_config()
コード例 #3
0
class WebConsts:
    name = "Peter's NAS Manager"


# First time login activated by choosing login template, which triggers correct API endpoints
# to finish setup
global login_page
login_page = "login.html"
if users.no_users:
    login_page = "first_login.html"
    import platform
    WebConsts.hostname = platform.uname()[1]

# We cannot initalize files with path because path may not be available right now
config = Config()
files = Files(config)


@app.route("/")
def root():
    if "username" in session:
        return render_template("index.html",
                               v=WebConsts,
                               user=session["username"])
    else:
        return render_template(login_page, v=WebConsts)
        # return redirect(url_for("login"))


@app.route('/logout')
def logout():