Update paramtools package to allow for references to csv files

Abierto
#1,232 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
json, python
Área
data

Línea de trabajo

Start by reading default_parameters.json, especially the chi_n entry and its current nested value structure; the issue does not name implementation files or tests. Investigate how OG-Core uses the paramtools package to load parameter values, then identify what tests cover parameter loading. Done means parameter values can optionally be referenced from .csv files while existing inline values continue to work.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Because the default_parameters.json has become somewhat large in terms of its memory footprint (17.7 MB) and cumbersome in its length (585,368 lines), I think we should update the paramtools package to allow for pointers to saved .csv files. This would ameliorate the size of the default_parameters file, and would make it easier to change and work with the large parameter vector, matrix, and array objects in input paramter objects like chi_n, e, and omega.

For example, the current entry for chi_n in default_parameters.json is a vector.

"chi_n": {
    "title": "Utility weight on disutility of labor supply",
    ...
    "type": "float",
    "number_dims": 1,
    "value": [
        {
            "value": [
                38.12000874,
                33.22762421,
                ...
                74.95045988,
                76.6230815
            ]
        }
    ],
    "validators": {
        "range": {
            "min": 0.0,
            "max": 10000.0
        }
    }
},

We could add a convention to paramtools that allows for the following path entries in the default_parameters.json file.

"chi_n": {
    "title": "Utility weight on disutility of labor supply",
    ...
    "type": "float",
    "number_dims": 1,
    "value": [{"value": {"file": "data/chi_n.csv"}}],
    "validators": {...}
}

Just moving those big arrays out of the default_parameters.json and into .csv files would reduce the total memory footprint of the new adjustes default_parameters.json file plus the corresponding .csv files by about 40%, just due to reduction in indentation white space in the .json file.

This could be an optional simplification. But it would massively simplify the parameter input process. And it might simplify the overall

cc: @jdebacker

Lenguaje dominante
Python
Estrellas
85
Forks
153
Merge medio
1 d 19 h
PR fusionados (30 d)
19

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PSLmodels/OG-Core

Todos los issues de PSLmodels/OG-Core

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.