Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
841f0c8
Add example data for techniques.
RKrahl Jul 24, 2020
8e22b9e
Merge branch 'develop' into icat-schema
RKrahl Dec 21, 2021
b5b3cba
Add Technique, DatasetInstrument, and DatasetTechnique to dump_queries
RKrahl Dec 21, 2021
bec9c85
Code formatting
RKrahl Dec 22, 2021
f66b4b6
Add new entity types
RKrahl Dec 22, 2021
2d960fd
Retain certain objects in the index to enable them to be referenced
RKrahl Dec 22, 2021
9ae2804
Move DataCollections in a separate chunk in ICAT data files
RKrahl Dec 22, 2021
734ad53
Add FundingReference and InvestigationFunding to dump_queries
RKrahl Dec 22, 2021
d684e98
Add DataPublication and related classes to dump_queries
RKrahl Dec 22, 2021
b4eb480
Tweak sorting for DataPublicationDate and DataPublicationUser
RKrahl Dec 23, 2021
673db38
Merge branch 'develop' into icat-schema
RKrahl Jul 2, 2022
3a2905e
Use PaNET terms for techniques in example data
RKrahl Jul 7, 2022
d1f3f9e
Add example ICAT data files and reference summary output for ICAT 5.0
RKrahl Jul 13, 2022
1e2727f
Review the dump queries
RKrahl Jul 13, 2022
f753571
Merge branch 'develop' into icat-schema
RKrahl Jul 22, 2022
e70fc5e
Add permissions needed for the ICAT 5.0 schema extensions
RKrahl Jul 22, 2022
99d06a8
Fixup b5b3cba: forgot to include technique
RKrahl Jul 24, 2022
e1fbb22
- Add creation of Techniques in init-icat.py
RKrahl Jul 24, 2022
405d552
Add InvestigationFacilityCycles in create-investigation.py
RKrahl Jul 25, 2022
cee985b
Take dataCollectionInvestigations (to be added in icat.server 5.0)
RKrahl Aug 11, 2022
c3bc655
Merge branch 'develop' into icat-schema
RKrahl Aug 13, 2022
0b3327f
Fix icatdata-5.0.xsd: add missing one to many relationships
RKrahl Aug 22, 2022
e5c3111
Update to last minute schema changes in icatproject/icat.server#297
RKrahl Aug 22, 2022
5ea182b
Merge branch 'develop' into icat-schema
RKrahl Oct 26, 2022
91fdb2a
Minor review of example data:
RKrahl Nov 8, 2022
f34c672
Example data:
RKrahl Nov 9, 2022
5ec06e3
Example data: add rules for the ingester
RKrahl Nov 9, 2022
d34bbc2
Example data: add a DataPublication
RKrahl Nov 9, 2022
1b10069
icat.server 5.0 has been released a while ago
RKrahl Nov 10, 2022
b07a326
Test suite: tighten assumptions that depend on the ICAT version
RKrahl Nov 10, 2022
313e6de
Example data: add a FundingReference
RKrahl Nov 23, 2022
3f8ae26
Fix: forgot dataPublicationType in the list of entity types
RKrahl Nov 23, 2022
580a144
Fix: need to include "type.facility" rather than merely "type" in the
RKrahl Nov 23, 2022
b01c7fa
Example data: add DataPublicationTypes
RKrahl Nov 23, 2022
a8ba879
Example data: add some arbitrary DataCollections
RKrahl Nov 23, 2022
5a459f1
Update changelog
RKrahl Nov 23, 2022
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
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Changelog
New features
------------

+ `#73`_, `#106`_: Add support for the ICAT schema 5.0 extensions.

+ `#102`_, `#104`_: Make the obj argument to client.new() case
insensitive.

Expand All @@ -28,6 +30,11 @@ New features
Incompatible changes and deprecations
-------------------------------------

+ The order and arrangement of data objects in the dump file created
by :ref:`icatdump` has been changed. In some cases, older versions
of :ref:`icatingest` will fail to read dump files written by new
versions of :ref:`icatdump`.

+ As a consequence of switching to pathlib for filesystem paths some
return values and variables are now :class:`pathlib.Path` objects
rather then :class:`str`. This affects:
Expand Down Expand Up @@ -74,6 +81,7 @@ Bug fixes and minor changes
+ Some (more) example scripts now require ICAT 4.4.0 or newer.

.. _#66: https://github.com/icatproject/python-icat/issues/66
.. _#73: https://github.com/icatproject/python-icat/issues/73
.. _#74: https://github.com/icatproject/python-icat/issues/74
.. _#75: https://github.com/icatproject/python-icat/pull/75
.. _#77: https://github.com/icatproject/python-icat/issues/77
Expand All @@ -83,6 +91,7 @@ Bug fixes and minor changes
.. _#103: https://github.com/icatproject/python-icat/pull/103
.. _#104: https://github.com/icatproject/python-icat/pull/104
.. _#105: https://github.com/icatproject/python-icat/pull/105
.. _#106: https://github.com/icatproject/python-icat/pull/106


0.21.0 (2022-01-28)
Expand Down
20 changes: 19 additions & 1 deletion doc/examples/add-investigation-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ def makeparam(t, pdata):
invsearch = "Investigation[name='%s']" % investigationdata['name']
investigation = client.assertedSearch(invsearch)[0]

instrumentname = data['instruments'][investigationdata['instrument']]['name']
instrsearch = "Instrument[name='%s' %s]" % (instrumentname, facility_const)
instrument = client.assertedSearch(instrsearch)[0]

technique = None
if "technique" in client.typemap:
t = data['instruments'][investigationdata['instrument']]['technique']
if t:
tn = data['techniques'][t]['name']
techsearch = "Technique [name='%s']" % tn
technique = client.assertedSearch(techsearch)[0]

need_dataset_types = set()
need_datafile_formats = set()
for ds in investigationdata['datasets']:
Expand Down Expand Up @@ -146,5 +158,11 @@ def makeparam(t, pdata):
pdata))
dataset.datafiles.append(datafile)

dataset.create()
if 'datasetInstruments' in dataset.InstMRel:
di = client.new("datasetInstrument", instrument=instrument)
dataset.datasetInstruments.append(di)
if 'datasetTechniques' in dataset.InstMRel and technique:
dt = client.new("datasetTechnique", technique=technique)
dataset.datasetTechniques.append(dt)

dataset.create()
24 changes: 24 additions & 0 deletions doc/examples/create-investigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import yaml
import icat
import icat.config
from icat.helper import parse_attr_string
from icat.query import Query

logging.basicConfig(level=logging.INFO)

Expand Down Expand Up @@ -116,6 +118,28 @@ def getUser(client, attrs):
if 'instrument' in s.InstRel:
s.instrument = instrument
investigation.shifts.append(s)
if 'investigationFacilityCycles' in investigation.InstMRel:
# ICAT 5.0 or newer
sd = investigation.startDate or investigation.endDate
ed = investigation.endDate or investigation.startDate
if sd and ed:
query = Query(client, "FacilityCycle", conditions={
"startDate": "<= '%s'" % parse_attr_string(ed, "Date"),
"endDate": "> '%s'" % parse_attr_string(sd, "Date"),
})
for fc in client.search(query):
ifc = client.new("investigationFacilityCycle", facilityCycle=fc)
investigation.investigationFacilityCycles.append(ifc)
if 'fundingReferences' in investigation.InstMRel:
for fr in investigationdata['fundingReferences']:
funding_ref = client.new('fundingReference')
initobj(funding_ref, data['fundings'][fr])
try:
funding_ref.create()
except icat.ICATObjectExistsError:
funding_ref = client.searchMatching(funding_ref)
inv_fund = client.new('investigationFunding', funding=funding_ref)
investigation.fundingReferences.append(inv_fund)
investigation.create()
investigation.addInstrument(instrument)
investigation.addKeywords(investigationdata['keywords'])
Expand Down
Loading