OceanParcels / Parcels

Main code for Parcels (Probably A Really Computationally Efficient Lagrangian Simulator)
https://www.oceanparcels.org
MIT License
294 stars 135 forks source link

Warnings vs ValueErrors with user provided params #1691

Open VeckoTheGecko opened 2 months ago

VeckoTheGecko commented 2 months ago

We have some warnings along the lines of

https://github.com/OceanParcels/Parcels/blob/5fff42c2ea4cc12d03df8c936dd391e251658c8f/parcels/field.py#L232-L238

Thoughts on just raising a ValueError instead? Its incorrect usage of the API, and I think explicitly failing would be nicer than implicitly working under different settings

VeckoTheGecko commented 2 months ago

I don't think its a major thing either way. Perhaps worth it only for v4

erikvansebille commented 2 months ago

Yes, good point that a ValueError would be more appropriate and cleaner here; the code then also don't need to implicitly decide that time_periodic is a more important setting than allow_time_interpolation