Skip to content

Converts specification look up into a factory.#153

Merged
FrankD412 merged 13 commits intospecification/yaml2.0from
yaml2.0/spec_factory
Oct 31, 2018
Merged

Converts specification look up into a factory.#153
FrankD412 merged 13 commits intospecification/yaml2.0from
yaml2.0/spec_factory

Conversation

@FrankD412
Copy link
Copy Markdown
Member

Since we're looking to update the YAML specification, it's probably about time we convert to a factory for specifications. The factory let's us retain reverse compatibility to older versions of the YAML specification and support other types of specifications in the future.

@FrankD412 FrankD412 requested a review from dinatale2 October 23, 2018 03:45
"""
Look up and retrieve a Specification by name.

:param spec_name: Name of the Specification to find.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is spec_name referring to the specification format (e.g., yaml)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no -- I couldn't figure out a good name for a Maestro YAML specification, but that could also be something like "cwl" for Common Workflow Language and things like that. I'm definitely welcome to suggestions either for naming or a better way to handle the "naming" to make it clearer.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about spec_type or spec_kind?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dinatale2 -- I updated to spec_type.

"""A factory class to retrieve different types of Specifications."""

_classes = {
"yaml": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: This means you're going to support other specifications in the future?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if I'll necessarily support them myself, but I did want to open up the ability to at least support versions. I also wanted to make it easier for others to add specification definitions also (I'm planning to add another PR for adding a command line parameter for spec type that defaults to YAML@latest).

"""
Look up and retrieve a Specification by name.

:param spec_name: Name of the Specification to find.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about spec_type or spec_kind?

@FrankD412 FrankD412 force-pushed the yaml2.0/spec_factory branch from 1d7c7a0 to 2897e47 Compare October 31, 2018 04:47
@FrankD412 FrankD412 merged commit d9a4371 into specification/yaml2.0 Oct 31, 2018
@FrankD412 FrankD412 deleted the yaml2.0/spec_factory branch October 31, 2018 05:19
FrankD412 added a commit that referenced this pull request Oct 31, 2018
* typos. fixes #141 (#154)

* Initial pass at a possible v2.0

* Moved specifications to their own submodule.

* Point Maestro to the new location for the YAML spec.

* Addition of a factory for finding specifications.

* Correction of a type of "Keyerror".

* Addition of version to docstring for get_specification.

* Update Maestro to use the SpecificationFactory.

* Removed global import of the DAG data structure.

* Updates to 'spec_name' to make it clear (changed to 'spec_type')

* Correction of flake8 errors.

* Correction of uncaught spec_name references.

* Correction of regex raw string.
FrankD412 added a commit that referenced this pull request Apr 24, 2019
* typos. fixes #141 (#154)

* Initial pass at a possible v2.0

* Moved specifications to their own submodule.

* Point Maestro to the new location for the YAML spec.

* Addition of a factory for finding specifications.

* Correction of a type of "Keyerror".

* Addition of version to docstring for get_specification.

* Update Maestro to use the SpecificationFactory.

* Removed global import of the DAG data structure.

* Updates to 'spec_name' to make it clear (changed to 'spec_type')

* Correction of flake8 errors.

* Correction of uncaught spec_name references.

* Correction of regex raw string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants