Difference between revisions of "Template:Chembox parametercheck/test"

From blackwiki
Jump to navigation Jump to search
imported>DePiep
imported>DePiep
 
(17 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
| framestyle = background:#baeefa; font-weight:normal; text-align:left; border:none; font-size:90%;<!--
 
| framestyle = background:#baeefa; font-weight:normal; text-align:left; border:none; font-size:90%;<!--
  
  Supercountings (over 7 countings)
+
  Supercountings (over 7 ID countings)
 
  -->|2={{#switch:{{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}
 
  -->|2={{#switch:{{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}
 
|0=<!-- ~no identifiers... -->
 
|0=<!-- ~no identifiers... -->
|1=[[:Category:Chemical articles with multiple compound IDs|Amulti-one]]<!-- TEST -->
+
|1=
 
|2=[[:Category:Chemical articles with multiple compound IDs|Bmulti]]
 
|2=[[:Category:Chemical articles with multiple compound IDs|Bmulti]]
 
|3=[[:Category:Chemical articles with multiple compound IDs|Cmulti]]
 
|3=[[:Category:Chemical articles with multiple compound IDs|Cmulti]]
Line 14: Line 14:
 
|6=[[:Category:Chemical articles with multiple compound IDs|Fmulti]]
 
|6=[[:Category:Chemical articles with multiple compound IDs|Fmulti]]
 
|#default=TEST max id count: {{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}<!-- other/err = no tracking -->
 
|#default=TEST max id count: {{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}<!-- other/err = no tracking -->
}}
+
}}<!--
 
 
Infobox needs index_labels?
 
-->{{#ifexpr:{{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1}}
 
|<!-- multiple IDs. Has indexes? -->{{#ifexpr:{{{_countIndex_label|-1}}}<=0
 
|[[:Category:Multiple chemicals in an infobox that need indexing|Needs-label_indexes]]
 
|<!-- no need, no cat -->}}
 
  
{{#switch:{{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}}  
+
INDEX_LABEL needed?
|{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}
+
-->|3={{#ifexpr:({{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1)
 +
|<!-- multiple IDs. Check: has indexes? (index_comments are ignored): -->{{#ifexpr:{{{_countIndex_label|-1}}}<=0
 +
|[[:Category:Multiple chemicals in an infobox that need indexing|needs label_indexes]]
 +
|[[:Category:Chemicals using indexlabels]]<!-- need to cat? -->}}}}<!--
  
}}<!--
+
NONE: Options 'none'
 
<!-- now: option 'none' only checked for main params (not the indexed 1-5 ones), for now
 
<!-- now: option 'none' only checked for main params (not the indexed 1-5 ones), for now
 
-->|5={{#if:{{{_hasCASnone|}}} |[[:Category:Chemicals that do not have a CAS registry number assigned]] }}<!--
 
-->|5={{#if:{{{_hasCASnone|}}} |[[:Category:Chemicals that do not have a CAS registry number assigned]] }}<!--
Line 31: Line 28:
 
-->|7={{#if:{{{_hasChemSpiderIDnone|}}} |[[:Category:Chemicals that do not have a ChemSpider ID assigned]] }}<!--
 
-->|7={{#if:{{{_hasChemSpiderIDnone|}}} |[[:Category:Chemicals that do not have a ChemSpider ID assigned]] }}<!--
  
 +
CAS NUMBER
 
-->|10={{#switch:{{{_countCASNo|-1}}}
 
-->|10={{#switch:{{{_countCASNo|-1}}}
 
|0=[[:Category:Chemical articles without CAS registry number]]
 
|0=[[:Category:Chemical articles without CAS registry number]]
Line 41: Line 39:
 
|#default=<!-- other/err = no tracking -->
 
|#default=<!-- other/err = no tracking -->
 
}}<!--
 
}}<!--
 +
 +
PUBCHEM
 
-->|11={{#switch:{{{_countPubChemCID|-1}}}
 
-->|11={{#switch:{{{_countPubChemCID|-1}}}
 
|0=[[:Category:Chemicals without a PubChem CID]]<!-- new. drugbox to follow. Mar 2017 -->
 
|0=[[:Category:Chemicals without a PubChem CID]]<!-- new. drugbox to follow. Mar 2017 -->
Line 52: Line 52:
 
}}<!--
 
}}<!--
  
 +
CHEBI
 
-->|12={{#switch:{{{_countChEBI|-1}}}
 
-->|12={{#switch:{{{_countChEBI|-1}}}
 
|0|1=
 
|0|1=
Line 62: Line 63:
 
}}<!--
 
}}<!--
  
 +
INCHI (skipped: StdInChI)
 +
cat:multiple INCHI's does not exist.
 
-->|13={{#switch:{{{_countInChI|-1}}}
 
-->|13={{#switch:{{{_countInChI|-1}}}
 
|0=[[:Category:Articles without InChI source]]
 
|0=[[:Category:Articles without InChI source]]
|1=
+
|#default=
|2=[[:Category:Chemical articles with multiple InChIs|B]]
 
|3=[[:Category:Chemical articles with multiple InChIs|C]]
 
|4=[[:Category:Chemical articles with multiple InChIs|D]]
 
|5=[[:Category:Chemical articles with multiple InChIs|E]]
 
|6=[[:Category:Chemical articles with multiple InChIs|F]]
 
|#default=<!-- other/err = no tracking -->
 
 
}}<!--
 
}}<!--
todo: check/compare with number of InChIKeys/use max.
 
  
 +
 +
CHEMSPIDER
 +
cat: Multiple SPIDER IDs does not exist.
 
-->|14={{#switch:{{{_countChemSpiderID|-1}}}
 
-->|14={{#switch:{{{_countChemSpiderID|-1}}}
 
|0=[[:Category:Chemical pages without ChemSpiderID]]
 
|0=[[:Category:Chemical pages without ChemSpiderID]]
|1=
+
|#default=
|2=[[:Category:Chemical articles with multiple ChemSpiderIDs|B]]
 
|3=[[:Category:Chemical articles with multiple ChemSpiderIDs|C]]
 
|4=[[:Category:Chemical articles with multiple ChemSpiderIDs|D]]
 
|5=[[:Category:Chemical articles with multiple ChemSpiderIDs|E]]
 
|6=[[:Category:Chemical articles with multiple ChemSpiderIDs|F]]
 
|#default=<!-- other/err = no tracking -->
 
 
}}<!--
 
}}<!--
  
-->|15={{#switch:{{{_countSMILES|-1}}}
+
SMILES
|0=<!-- [[:Category:Chemical articles without SMILES]] -->
+
Not categorised, cats do not exist.
|1=
 
|2=[[:Category:Chemical articles with multiple SMILESs|B]]
 
|3=[[:Category:Chemical articles with multiple SMILESs|C]]
 
|4=[[:Category:Chemical articles with multiple SMILESs|D]]
 
|5=[[:Category:Chemical articles with multiple SMILESs|E]]
 
|6=[[:Category:Chemical articles with multiple SMILESs|F]]
 
|#default=<!-- other/err = no tracking -->
 
}}<!--
 
  
  positives:
+
  JMOL
 
-->|20={{#if:{{{_hasJmol|}}} |[[:Category:Chemical articles having Jmol set]]}}<!--
 
-->|20={{#if:{{{_hasJmol|}}} |[[:Category:Chemical articles having Jmol set]]}}<!--
 
<!--
 
<!--
  
  negatives:
+
  OTHER IDs
 
-->|21={{#if:{{{_hasChEBIChEMBL|unk}}}  ||[[:Category:Articles without EBI source]]}}<!--
 
-->|21={{#if:{{{_hasChEBIChEMBL|unk}}}  ||[[:Category:Articles without EBI source]]}}<!--
 
-->|23={{#if:{{{_hasKEGG|unk}}}      ||[[:Category:Articles without KEGG source]]}}<!--
 
-->|23={{#if:{{{_hasKEGG|unk}}}      ||[[:Category:Articles without KEGG source]]}}<!--
 
-->|24={{#if:{{{_hasUNII|unk}}}      ||[[:Category:Articles without UNII source]]}}<!--
 
-->|24={{#if:{{{_hasUNII|unk}}}      ||[[:Category:Articles without UNII source]]}}<!--
-->|24={{#if:{{{_hasStdInChI|unk}}}{{#ifexpr:{{{_countInChI|0}}}>=1|yes|}} ||[[:Category:Articles without InChI source]]}}<!--
+
-->|25={{#if:{{{_hasStdInChI|unk}}}{{#ifexpr:{{{_countInChI|0}}}>=1|yes|}} ||[[:Category:Articles without InChI source]]}}<!--
  
  check if any data to be shown (else: idle Identifiers header)
+
  EMPTY ID HEADER? Check if any data to be shown (else: idle Identifiers header)
-->|28={{#if:{{{_hasOtherInput|unk}}} |<!--ok1 -->|{{#ifexpr:{{{_countCAS|0}}}+{{{_countPubChem|0}}}+{{{_countChEBI|0}}}>0|<!--ok2 -->|{{#if:{{{_hasChEBIChEMBL|}}}{{{_hasChemSpiderID|}}}{{{_hasKEGG|}}}{{{_hasInChI|}}}{{{_hasUNII|}}}{{{_hasInChIorKey|}}} |<!--ok3 -->|[[:Category:Chemical infoboxes with tracked parameters|I]]}}}}}}<!--
+
-->|28={{#if:{{{_hasOtherInput|unk}}} |<!--ok1 -->|{{#ifexpr:({{#invoke:math|max|-1 |{{{_countCASNo|0}}} |{{{_countPubChemCID|0}}} |{{{_countChemSpiderID|0}}} |{{{_countChEBI|0}}} |{{{_countInChI|0}}} |{{{_countInChIKey|0}}} |{{{_countSMILES|0}}} }}>1)|<!--ok2 -->|{{#if:{{{_hasChEBIChEMBL|}}}{{{_hasKEGG|}}}{{{_hasUNII|}}}{{{_hasStdInChIorKey|}}} |<!--ok3 -->|<!-- idle header, to track -->[[:Category:Chemical infoboxes with tracked parameters|I]]}}}}}}<!--
  
  indexes, QIDs:
+
  QIDs:
 
-->|30={{#if:{{{_hasQID|}}}|[[:Category:Chemicals having QID set]]}}<!--
 
-->|30={{#if:{{{_hasQID|}}}|[[:Category:Chemicals having QID set]]}}<!--
 
-->|31={{#ifexpr:{{{_countQIDindexed|0}}}>0 |[[:Category:Chemicals (indexed) having QID set]]}}<!--
 
-->|31={{#ifexpr:{{{_countQIDindexed|0}}}>0 |[[:Category:Chemicals (indexed) having QID set]]}}<!--
-->|32={{#ifexpr:{{{_countIndexlabel|0}}}>0 |[[:Category:Chemicals using indexlabels]]}}<!--
 
  
-->}}<noinclude>{{documentation}}</noinclude>
+
Categories not existing (counted IDs, not used for this):
 +
[[:Category:Chemical articles with multiple InChIs]]
 +
[[:Category:Chemical articles with multiple ChemSpiderIDs]]
 +
{{#switch:{{{_countSMILES|-1}}}
 +
|0=[[:Category:Chemical articles without SMILES]]
 +
|1=
 +
|2=[[:Category:Chemical articles with multiple SMILESs]]
 +
|#default=}}
 +
 
 +
-->}}<!-- eo collapsible list
 +
 
 +
--><noinclude>{{documentation}}</noinclude>

Latest revision as of 18:26, 18 March 2017

50px Template documentation[view] [edit] [history] [purge]

Use /test for development. To make sure all testsettings show in /testcases, and won't show in mainspace. When going live, copy to regular /sandbox, change settings fit for Mainspace, then copy /sandbox into live.

Difference with live, when developing:

  • In {{Chembox Identifers/sandbox}}, set
|addTESTdata=Chembox parametercheck/test
|addMAINdata=<blank>
This sets {{main other|1=|2=(all categories to test)}} for all returned input ({{Chembox headerbar}})
  • In /test:
Set [[COLON:Category:Category name]] (do show not categorise; required to not pollute the categories with testpages)
Format /test visuals, eg by making it a collapsible list.
Optionally, set [[COLON:Category:Category name|Label To Show]] (shows wl label).

Diff

See also