mirror of
https://github.com/gsi-upm/senpy
synced 2025-10-21 18:58:25 +00:00
New schema for parameters
* Improve extra requirement handling * New mechanism to handle parameters beforehand in chained calls, and the ability to get help on available parameters in chained calls (through `?help`). * Redefined Analysis, to reflect the new ontology * Add parameters as an entity in the schema * Update examples to include analyses and parameters * Add processing plugins, with an interface similar to analysis plugins * Update tests * Avoid duplication in split plugin Closes #51 Squashed commit of the following: commitd145a852e7
commit6a1069780b
commitca69bddc17
commitaa35e62a27
This commit is contained in:
@@ -85,7 +85,8 @@ class BaseMeta(ABCMeta):
|
||||
schema = json.load(f)
|
||||
|
||||
resolver = jsonschema.RefResolver(schema_path, schema)
|
||||
attrs['@type'] = "".join((name[0].lower(), name[1:]))
|
||||
if '@type' not in attrs:
|
||||
attrs['@type'] = "".join((name[0].lower(), name[1:]))
|
||||
attrs['_schema_file'] = schema_file
|
||||
attrs['schema'] = schema
|
||||
attrs['_validator'] = jsonschema.Draft4Validator(schema, resolver=resolver)
|
||||
@@ -244,10 +245,10 @@ class CustomDict(MutableMapping, object):
|
||||
return key[0] == '_'
|
||||
|
||||
def __str__(self):
|
||||
return str(self.serializable())
|
||||
return json.dumps(self.serializable(), sort_keys=True, indent=4)
|
||||
|
||||
def __repr__(self):
|
||||
return str(self.serializable())
|
||||
return json.dumps(self.serializable(), sort_keys=True, indent=4)
|
||||
|
||||
|
||||
_Alias = namedtuple('Alias', 'indict')
|
||||
|
Reference in New Issue
Block a user