Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ddlm-group] Task II: autogenerate a test for linked items

  • To: ddlm-group <ddlm-group@iucr.org>
  • Subject: [ddlm-group] Task II: autogenerate a test for linked items
  • From: James Hester <jamesrhester@gmail.com>
  • Date: Fri, 19 Oct 2018 13:13:35 +1100
  • DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;h=mime-version:reply-to:from:date:message-id:subject:to;bh=9sBXRT3yMqcazavpa9DGgobab8Ve5CgonMijOJ4rxFE=;b=BDji4DylTxIvWgOZM787oxgvvMEnHv3zgZTl/lotHyip6q0xiAFaM42iEthXnUTD4jjv/nXjGlvQxZ3C83t/7ykZVWG9ft6+2wzlErwkCioOLZFQtM56UG7unSXWUz4Tb+IW2nfAeti6CdOXMtvCP3ZMc0AWoVU3+WIbAgC7Ar1FyZ8ZVzUkH5p9WRcO3WFHzGsXFVdNkOtwxCw2AjAYM39AOj8hoKGzL2MR1E5Bb6JCEgYZIxHB/1+uk0GMZJN7hIFNsa9ZZPIm48VLVSG0p2PPZrd38O3ksm2T+jq8nBgNVsT1zPi1PCe8vu4ItT1N7exLKslEE8QggaueNcz5Ew==
This email seeks an autogenerated test for checking that values of a data name that is linked, via _name.linked_item_id, to another data name, only take values taken by that data name. I have not been able to construct such a test, because I can't loop over the values of a dataname from a different category, because I cannot look up the category that a given dataname belongs to at test generation time (because I only have access to the contents of a single domain dictionary definition in the standard dREL execution environment). So this is more of a challenge: please come up with such a test, or a way to make such a test work. In the sketch of a solution below, you need to somehow either find the values of $linked_category and $linked_dataname_object at test generation time, or instead directly access those values at test execution time.

# ... previous sections
link_template = """
found = 'False'
loop q as $linked_category {
    if ($dataname == q.$linked_dataname_object) found = 'True'
return found
if (method.id == 'linked') {
    method.expression = resolve_variables(link_template)

T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
ddlm-group mailing list

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Council for Science (admitted 1947). Member of CODATA, the ICSU Committee on Data. Member of ICSTI, the International Council for Scientific and Technical Information. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

ICSU Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.