Skip to content

Recursive Array Tools Notebook #281

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Recursive Array Tools Notebook #281

wants to merge 30 commits into from

Conversation

sumedha-k
Copy link
Contributor

No description provided.

@sumedha-k sumedha-k requested a review from aarmey October 24, 2020 01:07
@sumedha-k
Copy link
Contributor Author

@aarmey here's the notebook I mentioned in lab meeting today

@codecov
Copy link

codecov bot commented Oct 24, 2020

Codecov Report

Merging #281 (3bce3cb) into master (b43488c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #281   +/-   ##
=======================================
  Coverage   66.74%   66.74%           
=======================================
  Files           7        7           
  Lines         451      451           
=======================================
  Hits          301      301           
  Misses        150      150           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b43488c...811211b. Read the comment docs.

@aarmey
Copy link
Member

aarmey commented Oct 24, 2020

@sumedha-k I don't see the code you showed me?

@sumedha-k
Copy link
Contributor Author

@aarmey sorry about that, just updated it

@aarmey
Copy link
Member

aarmey commented Oct 25, 2020

I think I figured out the issue—take a look at the first cell I updated. The named elements in an SLVector just need to be single elements, not vectors.

@sumedha-k
Copy link
Contributor Author

@aarmey I included the information in recursive.ipynb in the last three cells.

@aarmey
Copy link
Member

aarmey commented Nov 10, 2020

I'm not sure I see the problem? You show that you can access arrPart.x[1].expression, but it doesn't work with arrPart2.x[1].expression because you didn't build it with labelled arrays. Perhaps you could add something you expect to work but doesn't? You're right that the ArrayPartition subarrays can't have their own labels, but I think we can live with that.

@aarmey
Copy link
Member

aarmey commented Nov 10, 2020

Oh, I see the issue. We do use structs as essentially labeled ArrayPartitions. Let me do a little digging...

@aarmey
Copy link
Member

aarmey commented Nov 10, 2020

I think I have an alternative approach for plugging this into ModelingToolkit. The TAMrates struct is really not the problem—it's the need to have an AbstractVector type at the ODE function interface. Do you see how to write a function that takes in a TAMrates and outputs a vector with all the values flattened out, and then vice versa? In other words, concatenate all the values in the struct to one vector? If we have these conversion functions I think we can accomplish the same thing without changing a ton of code.

@sumedha-k
Copy link
Contributor Author

Sounds good, should I add these function to the types.jl file or should I create a new file?

@aarmey
Copy link
Member

aarmey commented Nov 10, 2020

Yes, this can go in types.jl

@sumedha-k
Copy link
Contributor Author

@aarmey I couldn't figure out the source of this build error. It appears to be a result of the most recent merge commit.

@aarmey
Copy link
Member

aarmey commented Nov 28, 2020

Get rid of the changes you made to the Manifest file and I bet it'll work.

@sumedha-k
Copy link
Contributor Author

@aarmey I deleted the whole Manifest file and copied the one in the master branch but I'm still getting the error

elseif d isa TAMsType{T}
arr = ArrayPartition(flatten(d.Axl), flatten(d.MerTK), flatten(d.Tyro3))
elseif d isa hetRates{T}
arr = ArrayPartition(flatten(d.AM), flatten(d.MT), flatten(d.TM))
Copy link
Member

Choose a reason for hiding this comment

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

@sumedha-k you need an end on the end of this ifelse block.

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