Internal R6 object that process the hyper param grid generated in R
RGrid.Rd
A R6 object that manage the export of metadata and parquet file of the hyper param grid generated in R
Details
This object works by:
inherits from the BaseEx class.
accept a hyper param grid generated with rpwf_grid_gen_.
calculate the hash of the grid and check the hash is in the database.
if the hash is found in the database:
assign the pin_name associated with the hash of the grid to
self$pin_name
.check if the grid exists with
self$pin_name
.if not exists, assign the grid to
self$df
.if the file exists, then assign
NULL
to theself$df
attribute to stopself$export_parquet()
from executing.
if the hash is not found in the database:
assign the grid to
self$df
.generate a new pin_name to write the grid.
generate a SQL query to update the database with the new hash and new pin_name
update the database with the generated SQL query with
self$export_db()
write the parquet with
self$export_parquet()
Super class
rpwf::BaseEx
-> RGrid
Public fields
grid_obj
(
character()
)rpwf_grid_gen_()
performs necessary clean ups before the grid can be used in python
Methods
Method new()
Create a new instance of the RGrid class. These are grids made by
functions such as dials::grid_latin_hypercube
and dials::grid_regular
.
See BaseEx for details of the attributes.
Usage
RGrid$new(grid_obj, db_con)
Arguments
grid_obj
(
rpwf::rpwf_grid_gen_()
)rpwf_grid_gen_()
performs necessary clean ups before the grid can be used in python.db_con
(
DbCon
)
aDbCon
object, generated byrpwf_connect_db()
.
Method set_attrs()
Refresh the attributes using the current hash. Needed to be run because it updates the attributes with information from the Db