1.1 --- a/generator.py Sat Dec 10 00:11:49 2016 +0100
1.2 +++ b/generator.py Sat Dec 10 00:56:17 2016 +0100
1.3 @@ -224,9 +224,8 @@
1.4
1.5 # Define special attributes.
1.6
1.7 - signature = self.get_signature_for_callable(path)
1.8 attrs["__fn__"] = path
1.9 - attrs["__args__"] = encode_size("pmin", signature)
1.10 + attrs["__args__"] = encode_size("pmin", path)
1.11
1.12 self.populate_structure(Reference(kind, path), attrs, kind, structure)
1.13
1.14 @@ -278,9 +277,8 @@
1.15
1.16 # Set a special callable attribute on the instance.
1.17
1.18 - signature = self.get_signature_for_callable(path)
1.19 function_instance_attrs["__fn__"] = path
1.20 - function_instance_attrs["__args__"] = encode_size("pmin", signature)
1.21 + function_instance_attrs["__args__"] = encode_size("pmin", path)
1.22
1.23 # Produce two structures where a method is involved.
1.24
1.25 @@ -378,19 +376,18 @@
1.26 min_sizes = {}
1.27 max_sizes = {}
1.28
1.29 - for path, parameters in self.optimiser.parameters.items():
1.30 - argmin, argmax = self.get_argument_limits(path)
1.31 + # Determine the minimum number of parameters for each
1.32
1.33 - # Use the parameter signature in the constant names.
1.34 + for path in self.optimiser.parameters.keys():
1.35 + argmin, argmax = self.get_argument_limits(path)
1.36 + min_sizes[path] = argmin
1.37
1.38 + # Use the parameter table details to define the maximum number.
1.39 + # The context is already present in the collection.
1.40 +
1.41 + for parameters in parameter_tables:
1.42 signature = self.get_parameter_signature(parameters)
1.43 - min_sizes[signature] = argmin
1.44 - max_sizes[signature] = argmax
1.45 -
1.46 - # Record instantiator limits.
1.47 -
1.48 - if path.endswith(".__init__"):
1.49 - path = path[:-len(".__init__")]
1.50 + max_sizes[signature] = len(parameters)
1.51
1.52 self.write_size_constants(f_consts, "pmin", min_sizes, 0)
1.53 self.write_size_constants(f_consts, "pmax", max_sizes, 0)