Skip to content

Add std.parseFloat #759

Open
Open
@elkotito

Description

@elkotito

I would like to suggest a feature to parse strings into float numbers. I haven't found std.parseFloat() function in https://jsonnet.org/ref/stdlib.html. Since std.extVar returns a string it's impossible to use float numbers as external variables.

In my case, it would be useful since I used jsonnet to describe experiments in AllenNLP framework as sometimes I pass hyperparameters like learning rate as an environmental variable. Although I could obviously pass them using a top-level function, some platforms like Polyaxon requires to pass them as environmental variables.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions