Skip to content

Commit

Permalink
adding methods to Edge
Browse files Browse the repository at this point in the history
  • Loading branch information
prismofeverything committed Dec 20, 2024
1 parent 276b634 commit 591f6dc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
25 changes: 24 additions & 1 deletion bigraph_schema/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,33 @@
"""

class Edge:
def __init__(self):
config_schema = {}


def __init__(self, config=None, core=None):
if core is None:
raise Exception('must provide a core')

self.core = core

if config is None:
config = {}

self.config = self.core.fill(
self.config_schema,
config)

self.initialize(self.config)


def initialize(self):
pass


def initial_state(self):
return {}


def inputs(self):
return {}

Expand Down
8 changes: 4 additions & 4 deletions bigraph_schema/type_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ def __init__(self):
register_base_reactions(self)


def register_types(core, type_library):
def register_types(self, type_library):
for type_key, type_data in type_library.items():
if not core.exists(type_key):
core.register(
if not self.exists(type_key):
self.register(
type_key,
type_data)

return core
return self


def lookup(self, type_key, attribute):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages


VERSION = '0.0.47'
VERSION = '0.0.48'


with open("README.md", "r") as readme:
Expand Down

0 comments on commit 591f6dc

Please sign in to comment.