Changelog
Source:NEWS.md
erahumed 0.5.1
Bug fixes
- Fix bug that was causing errors in the plots of Perellonet, Perelló and Pujol outflows in the Shiny interface (#90).
Other
- The package has a new website, available at https://erahumed.github.io/erahumed/.
erahumed 0.5.0
Breaking changes
Names of columns representing outflows in
albufera_outflows
have been prepended withoutflow_
.Logic of
albufera_hb_global()
has been improved in such a way that the outflow columns are automatically recognized from the input data.frame, and do not need to be exactly"pujol"
,"perellonet"
and `"perello"
, as before.Former
irrigation
anddraining
columns from the output data.frame ofalbufera_hb_local()
becameideal_irrigation
andideal_draining
, to better reflect that these correspond to the originally scheduled irrigation and draining plans. In addition, new columnsreal_irrigation
andreal_draining
were added to the data.frame, which provide the actual irrigation and draining plans followed, modified by the plan delay.
New features
- Visualizations of the “extra outflow” variable have been added to the global hydrological balance module of the Shiny dashboard.
Under the hoods
- Unit testing of CA model block (#77).
erahumed 0.4.1
User visible changes
The default for the
height_thresh_cm
parameter ofca()
has been changed from2.5
to2
.The
albufera_management
data-set has a new columnseed_day
, which counts the number of day elapsed from the sowing day. This is also returned in the output data.frame ofalbufera_hb_local()
.erahumed_ca
S3 class now inherits fromhb_local
.
Under the hoods
Improvement in data.frame validity checks. The
assert_data.frame()
helper is now able to check column types. Noteworthy, this allows for much stricter tests in the"hb_local"
and"hb_global"
functions.Important performance improvements in the function
ca()
. These were mainly achieved by (i) removing validity checks in the low level functionca_to_cluster()
, supplanted by less costly checks at the level of thehb_local()
output; and (ii) bypassing computation usingDate
objects, thanks to the introducedseed_day
column in the output ofalbufera_hb_local()
(see above).
Documentation
- Improved documentation of
albufera_hb_global()
default parameters.
erahumed 0.4.0
New features
This version introduces a first draft for the new Chemicals Applications (CA) model block, which is meant to simulate the application of chemicals (fertilizers and pesticides), according to the previously obtained simulation of local water levels and water flows, which is the output of the hydrological balance (HB) block.
The basic ca()
function is provided, which takes as input an object of S3 class "hb_local"
(plus a few other optional input parameters), and returns a similar data-frame, with additional columns that provide the time series of chemical applications.
The accompanying dataset albufera_ca_schedules
provides the schedules for chemical applications in the Albufera lake, and is one of the customizable inputs to ca()
.
erahumed 0.3.2
Under the hoods
Shiny app continues to work if the Albufera Leaflet map cannot be loaded for any reason.
Added validation of date range to
albufera_hb_local()
.Tested exceptions raised by
albufera_hb_local()
s argument validity checks.Documented plotting method for
hb_local
andhb_global
S3 objects.
Miscellaneous
- Added Pablo Amador and Andreu Rico to package Authors@R.
erahumed 0.3.1
User visible changes
albufera_hb_local()
, called with default arguments, now retrieves its value from disk, from data installed alongside with erahumed.Due to the previous point, the package’s .tar.gz file size is much larger now, approximately 50MB. The file size will be tackled, as much as possible, in later releases.
Added light
print()
andsummary()
methods for the S3 objects returned byalbufera_hb_local()
andalbufera_hb_global()
.
Bug fixes
- Package data is prefixed everywhere in the code by the
erahumed::
NAMESPACE, so that executing this code without having the package attached does not lead to errors. In particular, callingerahumed::launch_app()
without attaching erahumed does no longer lead to an error.
erahumed 0.3.0
User visible changes
- New Shiny module to set parameters of the hydrological balance calculations.
- New Shiny module to modify input data to the algorithms.
Under the hoods
- Added shinytest2 testing infrastructure, for snapshot based tests to be developed later.
- Basic tests for plotting utilities (succeed with default arguments).
- Server testing of
hb_shiny.R
modules, #15.
erahumed 0.2.2
User visible changes
Documentation for the
albufera_hb_global()
andalbufera_hb_local()
wrappers.Exported
hbg_residence_time()
doc page.Former
albufera_weather
dataset becomesalbufera_petp
, and its structure is significantly simplified, now having only three columns:date
,rain_mm
andevapotranspiration_mm
(previously nameddate
,P
andETP
respectively). All changes get propagated to downstream tables, such as e.g.albufera_hb_global()
.
Algorithm change
- In previous versions of the algorithm, the plan delays upon failing to reach zero water levels on a given date were only being applied to the
ideal_height_cm
vector. In the present version, the draining and irrigation plan also get delayed. This has been observed to give rise to slightly more natural water profiles (in particular, the delay accumulated during summer is often less than 40 days, contrary to what used to happen with the previous version).
Under the hoods
- Add
"hb_local"
S3 class internal constructor (#21).
erahumed 0.2.1
User visible changes
Default arguments of
albufera_hb_global()
andalbufera_hb_local()
are now prepended with theerahumed::
namespace specifier.Unexported
residence_time()
Under the hoods
Separated logical units of
hb_global()
, collected inhb_global_units.R
.Introduced argument checking for
hb_global()
and its wrapperalbufera_hb_global()
.Introduced S3 class constructor for
"hb_global"
class objects (seehb_global_units_s3_class.R
).Important improvements in the testing infrastructure of
hb_global()
andalbufera_hb_global()
, both at the algorithmic level (through testing ofhb_global_units.R
) and at the level of exceptions raised by these two functions.
erahumed 0.2.0
User visible changes
Reduced number of
*_is_imputed
entries inhb_global
dataframes. Right now we are only providinglevel_is_imputed
andoutflow_is_imputed
, which should suffice FAPP.Big refactoring of the HB sector naming conventions. The wrappers become
albufera_hb_global/local()
, and the underlying functions arehb_global/local()
.
Under the hoods
- We complete the work started with v0.1.2 to separate the algorithms for computing global and local hydrological balance, from the wrappers used to feed this algorithms with our prepared datasets. In this version, the wrappers got significantly simplified, their only function being extracting variables from the imported datasets and feeding them to the algorithms (as it should be).
erahumed 0.1.2
Under the hoods
Important code refactors for the local balance algorithm, aiming to separate the abstract logic of the algorithm from our specific conventions used to pack together data for hydrological balance - the latter conventions being relegated to
hb_wrappers.R
functions. Fixes #3.Extensive unit testing of the logical units for the local balance algorithm.
Performance optimizations in local balance algorithm.
Sanity check functional tests for
plot.hb_local()
andplot.hb_global()
.
erahumed 0.1.1
Algorithm
- The main algorithm for local balance has been modified in such a way to ensure that the correct number of emptying events is always produced. This is achieved by delaying (by one day) the ideal water level plan whenever the ideal level is zero and the real level is above a certain threshold (2.5 mm by default). Moreover, outside of the sowing season, the water level plan is reset to the original one, in such a way that the Perellona does not get delayed.
erahumed 0.1.0
Algorithm
- Switched to an improved version of the algorithm to compute the local balance at the cluster level. The exactness of total outflows is enforced, in such a way that the sum of outflows of cluster that belong to a given ditch equals the total inflow to the Albufera lake from said ditch. Also, the logic of the algorithm was changed in such a way to enforce that no evaporation can occur when the water level of a cluster is zero. Warning. While correctly enforcing mass conservation, the present algorithm does not guarantee that the clusters will always be emptied for periods as long as planned, for the application of pesticides - both aspects being at odds with the previous version. Correctly enforcing the emptying of clusters will is the object of ongoing work.
erahumed 0.0.5
The outputs of
albufera_hydro_balance_global()
andalbufera_hydro_balance_local()
get class attributes"hb_global"
and"hb_local"
, respectively.Added cluster level plots to the shiny UI.
erahumed 0.0.3
User-visible changes
Big namespace refactor: all datasets get prepended with the prefix
"albufera_"
.The functions
albufera_storage_curve()
andpetp_volume_change()
were substituted by the function factorieslinear_storage_curve()
andlinear_petp_surface()
, that create functions that perform affine transformations.Function
albufera_hydro_balance()
was renamedalbufera_hydro_balance_global()
. Ditch inflows are not returned anymore. In correspondence, we add a new functionalbufera_hydro_balance_local()
, which at the current moment is still WIP and for testing purposes.Functions
albufera_hydro_balance_*()
now allow to specify storage curve and P-ETP surface by dedicated arguments. The defaults are defined throughout the new helpers mentioned in a previous point.New function
hydro_balance_global()
, that is meant to capture the abstract part of the global hydrological balance calculations. The functionalbufera_hydro_balance()
relies on this for its calculations of global balance.Residence time is now computed in terms of the total outflow, rather than inflow as before. This reflects the way we handle cases of unaccounted outflow in
hydro_balance_global()
(set inflow to zero).
erahumed 0.0.2
Added
clusters
andcluster_geometries
datasets, containing information at the cluster (i.e. aggregate of rice paddies) level.Separated computation of ditch inflow percents in a new function,
compute_ditch_inflow_pct()
, that leverages on theclusters
dataset.Corrected calculation of total outflow. In this calculation, the Perello daily outflow was being set to zero in the case of negative values. This does not make sense with the current computational approach.
Updated the
paddy_management
dataset: the irrigation and draining input binary vectors used previously were incomplete, with data until the middle of August. For this version, the inputs are defined until the 10th of September.
erahumed 0.0.1
First release. Contains a draft of the utilities for hydrological balance data analysis, and a skeleton of the visualization app (currently invoked with launch_app()
).