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

ACSetTransformation mapping attributes to nothing in StockFlow.jl no longer works after upgrading to Catlab 15 #838

Closed
neonWhiteout opened this issue Aug 17, 2023 · 4 comments

Comments

@neonWhiteout
Copy link
Contributor

@kris-brown

Previously, we mapped attributes in an ACSetTransformation to nothing to create a natural transformation for a pullback, of the form Position = x -> nothing. A particular example can be see in cell 11 here.

This no longer works for version 15 of Catlab.

Will check typed_product in algebraic petri to see if it can be used for this.

@neonWhiteout
Copy link
Contributor Author

typed_WeightModel=ACSetTransformation(WeightModel, l_type,
  S = [s,s,s],
  SV = [N],
  LS = [lsn,lsn,lsn],   
  F = [f_birth, f_death, f_fstorder, f_death, f_fstorder, f_death, f_aging, f_aging, f_aging],    
  I = [i_birth, i_aging, i_fstorder, i_aging, i_fstorder, i_aging], 
  O = [o_death, o_fstorder, o_aging, o_death, o_fstorder, o_aging, o_death, o_aging],
  V = [v_birth, v_death, v_fstorder, v_death, v_fstorder, v_death, v_aging, v_aging, v_aging],
  LV = [lv_death1, lv_fstorder1, lv_death1, lv_fstorder1, lv_death1, lv_aging1, lv_aging1, lv_aging1],
  LSV = [lsv_birth1],
  P = [p_μ, p_δ, p_rfstOrder, p_rfstOrder, p_δ, p_rage],
  LPV = [lpv_birth2, lpv_death2, lpv_fstorder2, lpv_death2, lpv_fstorder2, lpv_death2, lpv_aging2, lpv_aging2, lpv_aging2],
  Name = name -> nothing, Op=op->nothing, Position=pos->nothing
);
MethodError: no method matching coerce_attrvar_component(::Symbol, ::var"#46#49", ::TypeSet{Symbol}, ::TypeSet{Nothing}, ::Int64, ::Int64)

Closest candidates are:
  coerce_attrvar_component(::Symbol, !Matched::LooseVarFunction, ::TypeSet{T}, ::TypeSet{T′}, ::Int64, ::Int64) where {T, T′}
   @ Catlab [~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:436](https://file+.vscode-resource.vscode-cdn.net/home/silicon/Documents/Git/StockFlow.jl/examples/full_fledged_schema_examples_new/stratification/~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:436)
  coerce_attrvar_component(::Symbol, !Matched::AbstractVector, ::TypeSet{T}, !Matched::TypeSet{T}, ::Int64, ::Int64) where T
   @ Catlab [~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:420](https://file+.vscode-resource.vscode-cdn.net/home/silicon/Documents/Git/StockFlow.jl/examples/full_fledged_schema_examples_new/stratification/~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:420)
  coerce_attrvar_component(::Symbol, !Matched::VarFunction, ::TypeSet{T}, !Matched::TypeSet{T}, ::Int64, ::Int64) where T
   @ Catlab [~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:428](https://file+.vscode-resource.vscode-cdn.net/home/silicon/Documents/Git/StockFlow.jl/examples/full_fledged_schema_examples_new/stratification/~/.julia/packages/Catlab/olyoH/src/categorical_algebra/CSets.jl:428)

@kris-brown
Copy link
Contributor

Hi, this is a bug that should be quickly addressed - looks like we just need to add another method for coerce_attrvar_component. Thanks for pointing this out!

@epatters
Copy link
Member

@neonWhiteout, if #839 fixes your problems, I can tag a new patch release.

@neonWhiteout
Copy link
Contributor Author

@neonWhiteout, if #839 fixes your problems, I can tag a new patch release.

@epatters Yes, seems to be working, thank you!

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

No branches or pull requests

3 participants