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

Feature modification: alter input checks and errors #95

Open
lizlaw opened this issue Jul 17, 2018 · 2 comments
Open

Feature modification: alter input checks and errors #95

lizlaw opened this issue Jul 17, 2018 · 2 comments

Comments

@lizlaw
Copy link

lizlaw commented Jul 17, 2018

Hi,
I'm not sure how much of a hassle it might be, and it is a low priority suggestion... but from my end it would be easier if it wouldn't throw errors if, for example, there is a lockin specified, but there is no cell selected as a lockin. A warning would be fine. So long as it still computes ok! This is because sometimes in some of the scenario loops I am creating I sometimes end up with no lockin (e.g. if looping over sub-regions to do a scenario where planning is by sub-region, rather the region as a whole - I'm locking in existing protected areas, but these are not extant in all provinces). I can easily get around it by specifying an 'if' condition, but might be easier and cleaner if i didn't have to do this.
As I said, not a high priority!
Cheers muchly,
Liz

@jeffreyhanson
Copy link
Contributor

jeffreyhanson commented Jul 17, 2018

Yeah, I can see why it would be useful to have this functionality when looping over different inputs. I worry that implementing this functionality might confuse users and it might conflict with other functions in the sense that most of the functions in prioritizr are designed to fail hard when invalid inputs are supplied. I think one of the strengths of prioritizr is that it provides a consistent interface, so if we were to implement this functionality for the locked in constraints then we would have to make each other function (e.g. other constraints, targets, penalty functions) accept "empty" inputs and throw a warning (and perhaps generalize to empty list, matrices, spatial data types). I think this would be a lot of work, and personally I really like the fact that prioritizr throws an error when I have supplied invalid and empty input because this is almost always a mistake on my part when data wrangling. What do you think?

@ricschuster
Copy link
Member

Even though I sometimes wish prioritizr would accept 'empty' inputs, I completely understand where you are coming from Jeff and agree that the implementation as is makes a lot of sense. Plus, from a purely pragmatic standpoint, I would argue that its probably not worth the time to change so many prioritizr functions to allow 'empty' inputs.

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