math icon indicating copy to clipboard operation
math copied to clipboard

can we reorganize to put the constraint transforms into their own folder?

Open spinkney opened this issue 1 year ago • 4 comments

I'd like to add some additional constraint transforms and have these be referenced more easily. Is it a heavy lift to reorganize and have a folder dedicated to these?

spinkney avatar Feb 23 '24 14:02 spinkney

I don't think it'd be that heavy of a lift. What do you propose?

syclik avatar Feb 27 '24 03:02 syclik

I like this idea. Constraints are certainly a "special" function for stan math like how we have a folder for probability distributions. I'd actually go further and propose we merge the *_constrain and *_free files for each constrain as well. Each constrain needs an associated free and I think it makes sense to have them all together in one file.

What do you propose?

Just a constraints folder feels fine to me. For backwards compatibility should we leave the literal files there just empty? Otherwise code that includes those specific files would fail to compile

SteveBronder avatar Feb 27 '24 16:02 SteveBronder

For backwards compatibility should we leave the literal files there just empty?

Or just an include to the stan/math/*/constraints/this_constraint.hpp file

SteveBronder avatar Feb 27 '24 16:02 SteveBronder

I can just never find what the constraint files that I'm looking for, this would make it much easier to navigate. I'm good with constraints as the folder name.

I like this idea. Constraints are certainly a "special" function for stan math like how we have a folder for probability distributions. I'd actually go further and propose we merge the *_constrain and *_free files for each constrain as well. Each constrain needs an associated free and I think it makes sense to have them all together in one file.

I agree that they can be merged together. That would make it much easier to read the constraint code.

spinkney avatar Feb 27 '24 20:02 spinkney