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

refactor all random functions to use applyreduce #176

Open
asinghvi17 opened this issue Jul 13, 2024 · 4 comments
Open

refactor all random functions to use applyreduce #176

asinghvi17 opened this issue Jul 13, 2024 · 4 comments

Comments

@asinghvi17
Copy link
Member

No description provided.

@rafaqz
Copy link
Member

rafaqz commented Jul 13, 2024

E.g. flatten, unwrap, reconstruct

@asinghvi17 asinghvi17 changed the title refactor all random functions to applyreducs refactor all random functions to use applyreduce Jul 13, 2024
@asinghvi17
Copy link
Member Author

I think only flatten can be done this way - here's how:

function _flatten(f, target, geoms)
	return applyreduce(f, vcat, target, geoms)
end

(I think)

@rafaqz
Copy link
Member

rafaqz commented Jul 13, 2024

I think even apply itself can just use applyreduce! - or they can all share a more generic/abstract function.

I like the idea of having just one GeoInterface walker

@asinghvi17
Copy link
Member Author

Yeah agreed, we should do that. What's the best approach though? I had considered having an Apply struct, which carries the decompose, operate and reconstruct functions as type parameters. This could then have pretty flexible dispatch.

The other alternative is to have an apply iterator, but that would be hard to thread.

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

No branches or pull requests

2 participants