Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asdf validation error #297

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions asdf/tags/transform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
from .projections import *
from .polynomial import *
from .tabular import *
from .test_fail import *


13 changes: 13 additions & 0 deletions asdf/tags/transform/test_fail-1.1.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%YAML 1.1
---
$schema: "http://stsci.edu/schemas/yaml-schema/draft-01"
id: "http://stsci.edu/schemas/jwst_pipeline/test_fail-1.1.0"
tag: "tag:stsci.edu:jwst_pipeline/test_fail-1.1.0"
title: >
Test NRSZCoords

type: object
properties:
model:
$ref: ../asdf/transform/shift-1.1.0
required: [model]
42 changes: 42 additions & 0 deletions asdf/tags/transform/test_fail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from __future__ import absolute_import, division, unicode_literals, print_function

from ... import yamlutil
from .basic import TransformType
from astropy.modeling.core import Model

__all__ = ['TestFailType', 'TestFail']


class TestFail(Model):
"""
Class to compute the z coordinate through the NIRSPEC grating wheel.

"""
separable = False

inputs = ("x",)
outputs = ("z",)

def __init__(self, tab, **kwargs):
self.tab = tab
super(TestFail, self).__init__(**kwargs)

def evaluate(self, x):
return self.tab(x)


class TestFailType(TransformType):
name = "transform/test_fail"
types = [TestFail]
Copy link
Contributor

Choose a reason for hiding this comment

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

Try adding standard = 'jwst_pipeline' here

version = "1.1.0"


@classmethod
def from_tree_transform(cls, node, ctx):
tab = node['model']
return TestFail(tab)

@classmethod
def to_tree_transform(cls, model, ctx):
node = {'model': model.tab}
return yamlutil.custom_tree_to_tagged_tree(node, ctx)