Skip to content

simple-parsing 0.1.8

Version history | Download JSON

  • PyPI https://pypi.org/project/simple-parsing/

  • py.typed

  • Coverage


    %%{init: {"pie": {"textPosition": 0.85}, "theme": "neutral", "themeVariables": {"pieStrokeWidth": "1px"}}}%%
    pie title
        "Typed" : 722
        "Any" : 41
        "Untyped" : 220
    • 77.6% coverage
    • 73.4% coverage (strict)
    • 983 typable
      • 722 typed
      • 220 untyped
      • 41 Any
  • Typables


    %%{init: {"pie": {"textPosition": 0.85}, "theme": "neutral", "themeVariables": {"pieStrokeWidth": "1px"}}}%%
    pie title
        "functions" : 462
        "classes" : 442
        "other" : 40
    • 155 functions (+12 overloads)
      • 307 parameters
    • 49 classes
      • 138 methods (+3 overloads)
        • 244 parameters
      • 53 properties
    • 30 modules
      • 40 attrs

Modules

Module Coverage Coverage (strict) Typables Ignores
simple_parsing.annotation_utils.get_field_annotations 85.7% 85.7% 7 0
simple_parsing.conflicts 63.6% 63.6% 33 0
simple_parsing.decorators 66.7% 66.7% 3 0
simple_parsing.docstring 55.6% 55.6% 9 0
simple_parsing.help_formatter 71.4% 71.4% 14 0
simple_parsing.helpers.custom_actions 78.3% 73.9% 23 0
simple_parsing.helpers.fields 86.2% 82.8% 58 0
simple_parsing.helpers.flatten 46.7% 40.0% 15 0
simple_parsing.helpers.hparams 0.0% 0.0% 0 0
simple_parsing.helpers.hparams.hparam 70.6% 61.8% 34 0
simple_parsing.helpers.hparams.hyperparameters 73.3% 73.3% 30 1
simple_parsing.helpers.hparams.hyperparameters_test 0.0% 0.0% 11 0
simple_parsing.helpers.hparams.priors 78.1% 78.1% 32 1
simple_parsing.helpers.hparams.priors_test 0.0% 0.0% 7 0
simple_parsing.helpers.hparams.utils 100.0% 100.0% 2 0
simple_parsing.helpers.nested_partial 100.0% 33.3% 3 0
simple_parsing.helpers.partial 83.3% 66.7% 18 0
simple_parsing.helpers.serialization.decoding 92.9% 81.0% 42 0
simple_parsing.helpers.serialization.encoding 93.3% 60.0% 15 0
simple_parsing.helpers.serialization.serializable 79.2% 75.6% 221 0
simple_parsing.helpers.serialization.yaml_serialization 52.2% 52.2% 23 0
simple_parsing.helpers.subgroups 70.0% 60.0% 10 0
simple_parsing.parsing 79.4% 78.5% 107 0
simple_parsing.replace 75.0% 75.0% 8 0
simple_parsing.utils 84.7% 82.2% 118 1
simple_parsing.wrappers.dataclass_wrapper 69.2% 69.2% 39 0
simple_parsing.wrappers.field_metavar 60.0% 60.0% 5 0
simple_parsing.wrappers.field_parsing 95.5% 95.5% 22 0
simple_parsing.wrappers.field_wrapper 86.6% 77.6% 67 0
simple_parsing.wrappers.wrapper 85.7% 85.7% 7 0

Incomplete Annotations

simple_parsing.annotation_utils.get_field_annotations (1 missing, 0 any)

Symbol Typable Typed Any
attr logger 1 0 0

simple_parsing.conflicts (12 missing, 0 any)

Symbol Typable Typed Any
meth ConflictResolutionError.init 3 0 0
attr logger 1 0 0
meth ConflictResolver.init 2 0 0
meth ConflictResolver._remove 3 2 0
meth ConflictResolver._fix_conflict_explicit 2 1 0
meth ConflictResolver._fix_conflict_auto 2 1 0
meth ConflictResolver._fix_conflict_merge 3 2 0
attr ConflictResolver.conflict_resolution 1 0 0
attr ConflictResolver.max_attempts 1 0 0

simple_parsing.decorators (1 missing, 0 any)

Symbol Typable Typed Any
func main 3 2 0

simple_parsing.docstring (4 missing, 0 any)

Symbol Typable Typed Any
attr inspect_getsource 1 0 0
attr dp_parse 1 0 0
attr inspect_getdoc 1 0 0
attr logger 1 0 0

simple_parsing.help_formatter (4 missing, 0 any)

Symbol Typable Typed Any
meth SimpleHelpFormatter._format_args 3 2 0
meth SimpleHelpFormatter._get_default_metavar_for_optional 2 1 0
meth SimpleHelpFormatter._get_default_metavar_for_positional 2 1 0
attr logger 1 0 0

simple_parsing.helpers.custom_actions (5 missing, 1 any)

Symbol Typable Typed Any
meth BooleanOptionalAction.init 13 12 0
meth BooleanOptionalAction.call 5 4 1
meth BooleanOptionalAction.format_usage 1 0 0
attr BooleanOptionalAction.negative_prefix 1 0 0
attr BooleanOptionalAction.negative_option 1 0 0

simple_parsing.helpers.fields (8 missing, 2 any)

Symbol Typable Typed Any
func choice 6 5 0
func field 15 15 1
func flag 9 8 0
func list_field 3 2 0
func subparsers 4 3 1
func dict_field 3 2 0
func set_field 3 2 0
attr logger 1 0 0
func flags 5 4 0

simple_parsing.helpers.flatten (8 missing, 1 any)

Symbol Typable Typed Any
meth FlattenedAccess.getattr 2 1 0
meth FlattenedAccess.setattr 3 2 1
meth FlattenedAccess.getitem 2 0 0
meth FlattenedAccess.setitem 3 0 0
attr logger 1 0 0

simple_parsing.helpers.hparams.hparam (10 missing, 3 any)

Symbol Typable Typed Any
func log_uniform 6 5 0
func categorical 6 6 1
func uniform 8 7 0
func hparam 6 4 0
meth ValueOutsidePriorException.init 5 2 2
attr ValueOutsidePriorException.value 1 0 0
attr ValueOutsidePriorException.prior 1 0 0
attr logger 1 0 0

simple_parsing.helpers.hparams.hyperparameters (8 missing, 0 any)

Symbol Typable Typed Any
meth HyperParameters.post_init 1 0 0
meth HyperParameters.id 1 0 0
meth HyperParameters.space_id 1 0 0
meth HyperParameters.sample 1 0 0
meth HyperParameters.replace 2 0 0
meth Point.eq 2 1 0
attr logger 1 0 0

simple_parsing.helpers.hparams.hyperparameters_test (11 missing, 0 any)

Symbol Typable Typed Any
func test_choice_field_with_values_of_a_weird_type 1 0 0
func test_replace_int_or_float_preserves_type 1 0 0
func test_nesting 1 0 0
func test_field_types 1 0 0
func test_choice_field 1 0 0
func test_priors_with_shape 1 0 0
func test_to_array 1 0 0
func test_clip_within_bounds 1 0 0
func test_from_array 1 0 0
func test_contains 1 0 0
func test_strict_bounds 1 0 0

simple_parsing.helpers.hparams.priors (7 missing, 0 any)

Symbol Typable Typed Any
meth LogUniformPrior.post_init 1 0 0
meth UniformPrior.post_init 1 0 0
attr np 1 0 0
attr numpy_installed 1 0 0
meth NormalPrior.post_init 1 0 0
meth Prior.post_init 1 0 0
meth CategoricalPrior.post_init 1 0 0

simple_parsing.helpers.hparams.priors_test (7 missing, 0 any)

Symbol Typable Typed Any
func test_log_uniform_and_uniform_np 1 0 0
func test_log_uniform_and_uniform 1 0 0
func test_log_uniform_with_shape 1 0 0
func test_categorical_prior 1 0 0
func test_to_array 1 0 0
func test_log_uniform 1 0 0
func test_loguniform_prior 1 0 0

simple_parsing.helpers.nested_partial (0 missing, 2 any)

Symbol Typable Typed Any
meth npartial.call 3 3 2

simple_parsing.helpers.partial (3 missing, 3 any)

Symbol Typable Typed Any
func config_for 5 4 0
meth Partial.new 4 3 0
meth Partial.getattr 2 1 0
func infer_type_annotation_from_default 2 2 1
func adjust_default 2 2 2

simple_parsing.helpers.serialization.decoding (3 missing, 5 any)

Symbol Typable Typed Any
func decode_field 5 5 2
meth UnsafeCastingWarning.init 3 3 2
attr UnsafeCastingWarning.raw_value 1 0 0
attr UnsafeCastingWarning.decoded_value 1 0 0
func decode_literal 2 2 1
attr logger 1 0 0

simple_parsing.helpers.serialization.encoding (1 missing, 5 any)

Symbol Typable Typed Any
meth SimpleJsonEncoder.default 2 2 2
func encode 2 2 2
attr logger 1 0 0
func encode_namespace 2 2 1

simple_parsing.helpers.serialization.serializable (46 missing, 8 any)

Symbol Typable Typed Any
func dumps_yaml 4 2 0
attr JSONExtension.load 1 0 0
attr JSONExtension.dump 1 0 0
meth TorchExtension.dump 4 3 1
func dumps 3 2 0
func save_json 4 2 0
func loads_json 6 5 0
func dump_yaml 5 3 0
attr logger 1 0 0
func save 6 5 1
func ordered_dict_constructor 3 2 0
attr json_extension 1 0 0
meth TOMLExtension.load 2 2 1
meth TOMLExtension.dump 4 3 1
func save_yaml 4 2 0
func dumps_json 4 2 0
func load_json 6 5 0
meth SerializableMixin.init_subclass 3 2 0
meth SerializableMixin.dump_json 4 3 0
meth SerializableMixin.dump_yaml 4 3 0
meth SerializableMixin.dumps 3 2 0
meth SerializableMixin.dumps_json 3 2 0
meth SerializableMixin.dumps_yaml 3 2 0
meth SerializableMixin.load 5 4 0
meth SerializableMixin._load 5 4 0
meth SerializableMixin.load_json 5 4 0
meth SerializableMixin.load_yaml 5 3 0
meth SerializableMixin._save 4 3 0
meth SerializableMixin.save_yaml 4 3 0
meth SerializableMixin.save_json 3 2 0
meth SerializableMixin.loads_json 5 3 0
meth SerializableMixin.loads_yaml 5 4 0
func loads_yaml 6 5 0
meth NumpyExtension.load 2 2 1
meth NumpyExtension.dump 4 3 1
attr yaml_extension 1 0 0
func load_yaml 6 5 0
func dump_json 5 3 0
func dump 4 3 0
meth YamlExtension.load 2 2 1
meth YamlExtension.dump 4 3 1

simple_parsing.helpers.serialization.yaml_serialization (11 missing, 0 any)

Symbol Typable Typed Any
attr logger 1 0 0
meth YamlSerializable.dump 4 2 0
meth YamlSerializable.dumps 3 1 0
meth YamlSerializable.load 5 3 0
meth YamlSerializable.loads 5 3 0
meth YamlSerializable._load 5 3 0

simple_parsing.helpers.subgroups (3 missing, 1 any)

Symbol Typable Typed Any
func is_lambda 2 2 1
func subgroups 6 4 0
attr logger 1 0 0

simple_parsing.parsing (22 missing, 1 any)

Symbol Typable Typed Any
meth ArgumentParser.init 13 9 0
meth ArgumentParser.add_argument 3 2 0
meth ArgumentParser.parse_known_args 4 3 0
meth ArgumentParser.add_argument_group 6 3 0
meth ArgumentParser.print_help 3 1 0
meth ArgumentParser.set_defaults 3 3 1
attr ArgumentParser.conflict_resolution 1 0 0
attr ArgumentParser.add_option_string_dash_variants 1 0 0
attr ArgumentParser.argument_generation_mode 1 0 0
attr ArgumentParser.nested_mode 1 0 0
attr ArgumentParser.add_help 1 0 0
attr ArgumentParser.config_path 1 0 0
attr ArgumentParser.add_config_path_arg 1 0 0
func parse_known_args 14 13 0
func parse 15 13 0
attr logger 1 0 0

simple_parsing.replace (2 missing, 0 any)

Symbol Typable Typed Any
func replace 4 3 0
attr logger 1 0 0

simple_parsing.utils (18 missing, 3 any)

Symbol Typable Typed Any
meth InconsistentArgumentError.init 3 0 0
func is_dataclass_type 2 2 1
func get_type_name 2 1 0
func get_bound 2 0 0
func is_dataclass_instance 2 2 1
func compute_identity 3 2 0
func is_forward_ref 2 1 0
func is_typevar 2 1 0
func setattr_recursive 4 3 1
attr builtin_types 1 0 0
func dict_union 4 3 0
func getattr_recursive 3 2 0
func get_nesting_level 2 0 0
func camel_case 2 0 0
attr logger 1 0 0

simple_parsing.wrappers.dataclass_wrapper (12 missing, 0 any)

Symbol Typable Typed Any
meth DataclassWrapper.init 9 8 0
meth DataclassWrapper.add_arguments 2 1 0
meth DataclassWrapper.equivalent_argparse_code 2 1 0
meth DataclassWrapper.set_default 2 1 0
meth DataclassWrapper.merge 2 1 0
prop DataclassWrapper.descendants 1 0 0
prop DataclassWrapper.dest 1 0 0
attr DataclassWrapper.dataclass 1 0 0
attr DataclassWrapper.dataclass_fn 1 0 0
attr DataclassWrapper.prefix 1 0 0
attr DataclassWrapper.field_wrapper_class 1 0 0
attr logger 1 0 0

simple_parsing.wrappers.field_metavar (2 missing, 0 any)

Symbol Typable Typed Any
attr logger 1 0 0
func log_results 2 1 0

simple_parsing.wrappers.field_parsing (1 missing, 0 any)

Symbol Typable Typed Any
attr logger 1 0 0

simple_parsing.wrappers.field_wrapper (9 missing, 6 any)

Symbol Typable Typed Any
meth FieldWrapper.init 4 3 0
meth FieldWrapper.call 6 5 1
meth FieldWrapper.duplicate_if_needed 2 2 1
meth FieldWrapper.postprocess 2 2 2
meth FieldWrapper.set_default 2 1 1
meth FieldWrapper.str 1 0 0
meth FieldWrapper.add_subparsers 2 1 0
meth FieldWrapper.equivalent_argparse_code 1 0 0
prop FieldWrapper.nargs 1 0 0
prop FieldWrapper.default 1 1 1
prop FieldWrapper.is_list 1 0 0
attr logger 1 0 0

simple_parsing.wrappers.wrapper (1 missing, 0 any)

Symbol Typable Typed Any
meth Wrapper.init 1 0 0

Type-Ignore Comments

Flavor Count
type: ignore 3