Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
added exec count fixer in utils
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Mar 4, 2024
1 parent ffe6069 commit c915252
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions biosimulator_processes/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict
from basico import biomodels, load_model_from_string
from process_bigraph import Composite, pf
import nbformat
from pydantic import BaseModel


Expand Down Expand Up @@ -227,3 +228,16 @@ def generate_sed_model_config_schema(

def perturb_parameter(param: str, degree: float, config: Dict):
pass


def fix_execution_count(notebook_path):
with open(notebook_path, 'r', encoding='utf-8') as f:
nb = nbformat.read(f, as_version=4)

for cell in nb['cells']:
if cell['cell_type'] == 'code':
if 'execution_count' not in cell:
cell['execution_count'] = None

with open(notebook_path, 'w', encoding='utf-8') as f:
nbformat.write(nb, f)

0 comments on commit c915252

Please sign in to comment.