-
Notifications
You must be signed in to change notification settings - Fork 8
Added Legolas with first node/edge schemes. #43
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,11 +59,19 @@ end | |
| # Read into memory for now with read, to avoid locking the file, since it mmaps otherwise. | ||
| # We could pass Mmap.mmap(path) ourselves and make sure it gets closed, since Arrow.Table | ||
| # does not have an io handle to close. | ||
| read_table(entry::AbstractString) = Arrow.Table(read(entry)) | ||
|
|
||
| function read_table(entry) | ||
| @assert Tables.istable(entry) | ||
| return entry | ||
| _read_table(entry::AbstractString) = Arrow.Table(read(entry)) | ||
| _read_table(entry) = entry | ||
|
|
||
| function read_table(entry; schema = nothing) | ||
| table = _read_table(entry) | ||
| @assert Tables.istable(table) | ||
| if !isnothing(schema) | ||
| sv = schema() | ||
| validate(Tables.schema(table), sv) | ||
| R = Legolas.record_type(sv) | ||
| foreach(R, Tables.rows(table)) # construct each row | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know roughly how long this takes for the national schematization? Especially the forcing can contain millions of rows, and sometimes only a fraction of them is used for short calculations. Also, the result of this loop is not kept, that means that we only get errors, but any changes like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, at the moment I only check the types and for empty strings. And I rather throw on error than clamp some values, but that's up for debate.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok yeah right now we don't use something like clamp, and I can't directly think of a use case where it would be better than an error, so let's keep it like this. Performance was answered here: #43 (comment) |
||
| end | ||
| return DataFrame(table) | ||
| end | ||
|
|
||
| "Create an extra column in the forcing which is 0 or the index into the system parameters" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.