Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1 #15

Merged
merged 16 commits into from
Feb 3, 2020
Merged

Update 1 #15

merged 16 commits into from
Feb 3, 2020

Conversation

cledna
Copy link
Collaborator

@cledna cledna commented Dec 9, 2019

Modified get_model() function to require no initial arguments. Output of get_model() is now a tuple of (1: model, 2: segment-region dictionary, and 3: initialization parameters). Using tuple structure because 2 and 3 are needed for the write_ciam() function to write the model output into csv format.

Copy link
Member

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

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

Just some random changes here in there. The comment re file reading paths applies to all the file reading instances.

src/ciamhelper.jl Outdated Show resolved Hide resolved
if f==nothing
f=joinpath(dirname(pathof(MimiCIAM)),"../data/batch/init.txt")
end
varnames=CSV.read(open(f),header=true)
Copy link
Member

Choose a reason for hiding this comment

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

Can we use CSVFiles.jl instead of CSV to read files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is an with CSVFiles handling larger files (>2MB), so sticking with CSV for now

src/main.jl Outdated Show resolved Hide resolved
@davidanthoff
Copy link
Member

So I think we are still trying to get to a get_model that just returns an m, right? And then we can merge?

@cledna
Copy link
Collaborator Author

cledna commented Dec 18, 2019

Yes, I'm working on that now.

@cledna
Copy link
Collaborator Author

cledna commented Dec 19, 2019

Updated get_model() to return only the model instance and modified write_ciam() to not require additional inputs.

Copy link
Member

@davidanthoff davidanthoff left a comment

Choose a reason for hiding this comment

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

Nice, this looks good to me!

Maybe @FrankErrickson or @lrennels could also take a look?

@lrennels
Copy link
Collaborator

I'll take a look this afternoon!

src/ciam.jl Outdated

return m
return (m)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can just use return m not return (m) since the latter is a single tuple which simplifies to the former anyways and thus both return a Model type.

Choose a reason for hiding this comment

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

Actually, as in python, (1) is just an Int, 1. To make it a one-element tuple, you have to add the weird trailing comma, (1,).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry yes that’s what I meant, so to simplify this code there’s really no reason for the parentheses unless the intention was a tuple right?

@cledna cledna merged commit 5fa09d5 into master Feb 3, 2020
@davidanthoff davidanthoff deleted the update-1 branch March 26, 2020 21:00
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.

4 participants