ivcurves 1.0 documentation

  • Scoreboard
  • Test Cases
  • How to Participate
  • Submissions
  • Documentation
  • Compare Curves
    • ivcurves.compare_curves._find_x_intersection
    • ivcurves.compare_curves._find_distance
    • ivcurves.compare_curves.score_curve
    • ivcurves.compare_curves.score_parameters
    • ivcurves.compare_curves.calc_precise_curve
    • ivcurves.compare_curves._get_test_sets_to_score
    • ivcurves.compare_curves.write_test_set_score_per_curve_csvs
    • ivcurves.compare_curves.write_overall_scores_csv
  • Precise
    • ivcurves.precise.max_power_pt_finder
    • ivcurves.precise.golden_search
    • ivcurves.precise.lambert_i_from_v
    • ivcurves.precise.lambert_v_from_i
    • ivcurves.precise.diff_lhs_rhs
    • ivcurves.precise.get_precise_i
    • ivcurves.precise.build_precise_json
  • Utils
    • ivcurves.utils.set_globals
    • ivcurves.utils.constants
    • ivcurves.utils.mp_num_digits_left_of_decimal
    • ivcurves.utils.mp_nstr_precision_func
    • ivcurves.utils.read_iv_curve_parameter_sets
    • ivcurves.utils.make_iv_curve_name
    • ivcurves.utils.get_filenames_in_directory
    • ivcurves.utils.load_json
    • ivcurves.utils.save_json
  • Plots
    • ivcurves.plots.plot_precise_iv_curves
    • ivcurves.plots.scoring_visualization
  • GitHub Workflows
    • Score Submission
    • Record Scores
    • Update Scores
    • Pytest
    • Utility Python Scripts
      • Print JSON as ENV
        • workflows.utils.print_json_as_env.validate_pr_config
        • workflows.utils.print_json_as_env.format_bool_variables
        • workflows.utils.print_json_as_env.format_path_variables
        • workflows.utils.print_json_as_env.format_variable_values
        • workflows.utils.print_json_as_env.print_json_as_env
      • Record Scores
        • workflows.utils.record_scores.load_overall_scores
        • workflows.utils.record_scores.validate_overall_scores
        • workflows.utils.record_scores.write_overall_scores_to_database
On this page
  • print_json_as_env.py

Print JSON as ENV#

print_json_as_env.py#

Prints entries in flat JSON object like environment variables.

usage: print_json_as_env.py [-h]
                            [--validate-pr-config | --no-validate-pr-config]
                            [--split-path-variables | --no-split-path-variables]
                            [--quote-path-variables | --no-quote-path-variables]
                            path
path#

Path to the JSON file.

-h, --help#

show this help message and exit

--validate-pr-config, --no-validate-pr-config#

Runs the pr_config.json validator.

--split-path-variables, --no-split-path-variables#

Adds two additional variables when a path variable P is encountered: a parent directory variable (P_PATH), and a filename variable (P_FILENAME).

--quote-path-variables, --no-quote-path-variables#

Wrap path variables in double quotes (“).

validate_pr_config(submissions_root_path, ...)

Validates that RUN_SCORER is a Boolean, and REQUIREMENTS and SUBMISSION_MAIN are paths that point to existing files, and converts the values of REQUIREMENTS and SUBMISSION_MAIN to pathlib.Path.

format_bool_variables(key, validated_dict, ...)

Converts validated_dict[key] from a bool to a bash-style Boolean string If validated_dict[key] is not a bool, nothing is done.

format_path_variables(key, validated_dict[, ...])

Converts validated_dict[key] from a pathlib.Path to a string.

format_variable_values(validated_dict, **options)

Iterates through the keys of validated_dict and runs functions to modify their corresponding values.

print_json_as_env(validated_dict)

Iterates through validated_dict and prints the string '{key}={value}'.

previous

Utility Python Scripts

next

workflows.utils.print_json_as_env.validate_pr_config

© Copyright 2022, ivcurves Development Team.

Created using Sphinx 5.0.2.