Skip to content

Commit

Permalink
change initialize_problem to require keyword args (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Sep 4, 2024
1 parent 3879ae4 commit 2b2488e
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 535 deletions.
14 changes: 7 additions & 7 deletions examples/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"outputs": [],
"source": [
"pyro_sim = Pyro(solver)\n",
"pyro_sim.initialize_problem(problem_name, param_file)"
"pyro_sim.initialize_problem(problem_name, inputs_file=param_file)"
]
},
{
Expand Down Expand Up @@ -198,13 +198,13 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_IGNORE_OUTPUT \n",
"extra_parameters = {'vis.dovis': False, 'mesh.nx': 8, 'mesh.ny':8, 'particles.do_particles': False}\n",
"pyro_sim.initialize_problem(problem_name, param_file, inputs_dict=extra_parameters)\n",
"pyro_sim.initialize_problem(problem_name, inputs_file=param_file, inputs_dict=extra_parameters)\n",
"pyro_sim.run_sim;"
]
},
Expand All @@ -217,7 +217,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {
"tags": [
"nbval-ignore-output"
Expand Down Expand Up @@ -257,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -266,7 +266,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -340,7 +340,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand Down
61 changes: 7 additions & 54 deletions presentations/pyro_intro.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyro/pyro_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, solver_name, from_commandline=False):

self.is_initialized = False

def initialize_problem(self, problem_name, inputs_file=None, inputs_dict=None,
def initialize_problem(self, problem_name, *, inputs_file=None, inputs_dict=None,
other_commands=None):
"""
Initialize the specific problem
Expand Down
Loading

0 comments on commit 2b2488e

Please sign in to comment.