Discussion List Archives

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

[ddlm-group] Questions about Methods

  • To: Group finalising DDLm and associated dictionaries <ddlm-group@iucr.org>
  • Subject: [ddlm-group] Questions about Methods
  • From: David Brown <idbrown@mcmaster.ca>
  • Date: Thu, 20 May 2010 11:29:29 -0400
Title:
I would like to shift the focus from the front end of DDLm to the back end.

I am now working on converting CIF dictionaries and I would like to start some threads on this topic.

In this thread my questions are related to Methods which, being a new feature, raise a number of questions about how they are to be used.

BACKGROUND
In going through the proof-of-concept CIF dictionary I note that the items that describe structure factors have loops containing two methods: the first method defines the units of the structure factors which depend on the radiation being used in the diffraction experiment, and the second method calculates the value of the structure factor.

The CIF dictionary defines many different structure factors: F, F^2, I, each with an observed and a calculated value, and then there are the standard uncertainties (which need a dictionary entry for backward compatibility). 

PROBLEM 1.  DOES THE DATANAME _IMPORT_LIST_ID HAVE A SPECIAL STATUS?
The 'method' which assigns the units is repeated in each of the structure factor definitions, so it would seem to be an ideal place for IMPORTing the method into the various places in the dictionary where it is used.  But there is a problem.

The methods are looped and we need to import a second method into a loop that already includes a method for the value.  Under current rules, the first data name encountered after the looped values appear terminates the loop, and since _import_list_id is a data name it should, according to our rules, terminate the loop before we even get to the second method.

BUT this is not necessarily so.  Before a CIF dictionary is used it would normally be expanded by replacing all the IMPORT statements, so that by the time the dictionary is brought into use the _import_list_id data names will all have been replaced by a properly constructed method.

HOWEVER, if people decide to expand the dictionary on the fly, there might be problem if the loop is parsed before the import is exercised.

The QUESTION is: Is it legitimate to include _import_list_id inside a loop?  The implication is that IMPORT items have a special status that REQUIRES the import_list_id statement to be replaced by expanding the dictionary before it is used.  I am comfortable with _import_list_id having a special status but people using dictionaries need to be aware of this, and of the fact that it is not correct to use an unexpanded dictionary (i.e., one containing an _import_list_id data name) to read a CIF.  I am looking for confirmation from the group that this is correct because it may need to be made explicit at some point.

PROBLEM 2. ALTERNATIVE METHODS. As mentioned above, the proof-of-concept dictionary has loops containing more than one method but I believe in all these cases both methods are expected to be executed if the value cannot be found in the CIF being read.  In discussions with Syd he pointed out that in designing the methods they made sure that it would be possible to calculate the value of an item in more than one way, i.e., either using measured items (e.g., Fobs^2 from I) or, going in the reverse direction, using derived items (e.g., Fobs^2 from Fobs).  This implies that a loop might contain alternative methods as well as sequential methods.  If alternative methods are allowed, we need some way to identify the different alternatives so that all the relevant methods, and only the relevant methods, are executed in the event that a value is not already present in the CIF.  If these alternatives are flagged, the flag could also be used to enable external control of the calculation.  It would also be necessary to define a default method. or more correctly an hierarchy of default methods.

The QUESTION is: Should we allow alternative methods or not?  If alternatives are allowed, what is the mechanism by which a particular method is selected?  If the choice is made by the user, how does the user communicate with the dictionary?

The approach I recommend is to add the item _method.id whose value would be an integer representing the default order in which the methods are to be attempted.  If method 1 does not work (because the items it needs are not present) method 2 is attempted.  This is continued until a method succeeds or all the methods are exhausted.  The implementation might keep a log allowing the user to determine which method had been used, but control would be determined entirely within the dictionary.  In advanced applications the presence of a numeric flag would allow the user to select the method to be used, or to change the hierarchy to be used in reading a particular CIF.  If we adopt this view, _method.id would have to be added to the DDLm dictionary.

Any comments?

David

begin:vcard
fn:I.David Brown
n:Brown;I.David
org:McMaster University;Brockhouse Institute for Materials Research
adr:;;King St. W;Hamilton;Ontario;L8S 4M1;Canada
email;internet:idbrown@mcmaster.ca
title:Professor Emeritus
tel;work:+905 525 9140 x 24710
tel;fax:+905 521 2773
version:2.1
end:vcard

_______________________________________________
ddlm-group mailing list
ddlm-group@iucr.org
http://scripts.iucr.org/mailman/listinfo/ddlm-group

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

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

International Science Council 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.