Skip to content

Basic XML modification for number-of-cells parameter#9

Open
MikeDeLucia wants to merge 2 commits into
mvpfrom
xml_modification
Open

Basic XML modification for number-of-cells parameter#9
MikeDeLucia wants to merge 2 commits into
mvpfrom
xml_modification

Conversation

@MikeDeLucia
Copy link
Copy Markdown
Collaborator

No description provided.

@MikeDeLucia MikeDeLucia requested a review from gabroo January 31, 2022 15:59
Copy link
Copy Markdown
Owner

@gabroo gabroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, few minor comments, then we can merge this

Comment thread README.md Outdated
Comment thread engine/server/server.go Outdated
Comment thread engine/server/server.go Outdated
Comment thread engine/server/server.go Outdated
@MikeDeLucia MikeDeLucia requested a review from gabroo March 9, 2022 03:34
Copy link
Copy Markdown
Owner

@gabroo gabroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the updates! few quick fixes!

Comment thread engine/server/server.go
}

// Change model path to individual simulation's modified xml
model = xmlConvert(model, out, params)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think xmlConvert should have return type (string, error), see comment below

Comment thread engine/server/server.go
return id, err
}

func xmlConvert(model string, out string, params *pb.Params) (string){
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change return type to (string, error) here and instead of panic below, just return the error

Comment thread engine/server/server.go
model_path := out + "/barkley3d_coupling.xml"
doc.WriteToFile(model_path)

return model_path
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can return model_path, nil here

Comment thread protos/controller.proto
@@ -5,7 +5,7 @@ import "common.proto";
option go_package = ".;pb";

// Human-readable parameters for our GJSM model.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this comment on top of the Params struct? then the swagger docs will show it

Comment thread engine/server/server.go
}

// Write to output directory
model_path := out + "/barkley3d_coupling.xml"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the name from model param instead of hardcoding

}
id, err := startJob(s.c, "models/three_layer.xml", "out")

id, err := startJob(s.c, "models/barkley3d_coupling.xml", "out", rq)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you grab the model/out strings from the RunRequest instead of hardcoding? that'll make it easier to change later

Comment thread engine/server/server.go
model, out := rq.Model, rq.Out
id, err := startJob(model, out, s.jobs)
model, out, params := rq.Model, rq.Out, rq.Params
// had to change here to get this to compile even though it isn't used right now -MD
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, that's fine; you can remove this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants