This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
forked from vivarium-collective/biosimulator-processes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dedd260
commit 34fe120
Showing
3 changed files
with
21 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +0,0 @@ | ||
from process_bigraph import process_registry | ||
|
||
|
||
# Define a list of processes to attempt to import and register | ||
processes_to_register = [ | ||
('cobra', 'cobra_process.CobraProcess'), | ||
('copasi', 'copasi_process.CopasiProcess'), | ||
('smoldyn', 'smoldyn_process.SmoldynProcess'), | ||
('tellurium', 'tellurium_process.TelluriumProcess'), | ||
] | ||
|
||
for process_name, process_path in processes_to_register: | ||
module_name, class_name = process_path.rsplit('.', 1) | ||
try: | ||
# Dynamically import the module | ||
process_module = __import__( | ||
f'biosimulator_processes.processes.{module_name}', fromlist=[class_name]) | ||
# Get the class from the module | ||
process_class = getattr(process_module, class_name) | ||
|
||
# Register the process | ||
process_registry.register(process_name, process_class) | ||
print(f"{class_name} registered successfully.") | ||
except ImportError as e: | ||
print(f"{class_name} not available. Error: {e}") | ||
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