Changelog
1.5.1 (2024-10-25)
Bug fixes and minor changes
#165: Fix missing documentation on the environment injected by
icat.ingest.IngestReader
into the input as changed in 1.5.0.
1.5.0 (2024-10-11)
New features
#160, #161, #163: Add class attributes to
icat.ingest.IngestReader
to make some prescribed values in the transformation to ICAT data file format configurable.
Bug fixes and minor changes
1.4.0 (2024-08-30)
New features
#155, #156: Add an option to disable parsing of command line arguments in
icat.config.Config
.
Bug fixes and minor changes
Misc
#157:
icat.ingest
now considered stable.
1.3.0 (2024-03-21)
New features
#143, #144: Make it easier to configure XSLT files to use for processing the input in custom versions of
icat.ingest.IngestReader
.#148, #149: Inject an additional element with environment information into the input data in
icat.ingest.IngestReader
.#146, #147, #151: Better error handling in
icat.ingest.IngestReader
.
Incompatible changes
#144: Drop class attribute
icat.ingest.IngestReader.XSLT_name
in favour oficat.ingest.IngestReader.XSLT_Map
.Note that
icat.ingest
has been declared experimental for now.
Bug fixes and minor changes
1.2.0 (2023-10-31)
New features
#125, #140: Add support to link datasets with samples in
icat.ingest
.#122, #133: Allow referencing related objects by reference key in object references in XML ICAT data file format.
Incompatible changes
#138, #139: Fix the input that
icat.ingest
generates on the fly to be valid according to the ICAT data file schema. This also affects the input that the module accepts: the order of subelements of data need to be changed such that datasetTechnique comes before datasetInstrument.Note that
icat.ingest
has been declared experimental for now.
Bug fixes and minor changes
#131, #135: Fix
icat.ids.IDSClient.getApiVersion()
to yield correct results for ids.server 2.0.0 and newer.#132, #136: Fix a spurious
AttributeError
on cleanup after connecting to an invalid url.
1.1.0 (2023-06-30)
New features
#113, #123: Add module
icat.ingest
.#124: Add an optional keyword argument keepInstRel to
icat.entity.Entity.truncateRelations()
.
Bug fixes and minor changes
#112, #118: Extend icatdata XSD adding extra attributes to reference objects.
#111, #121: Change the type of
icat.client.Client.Register
toweakref.WeakValueDictionary
, fixing a memory leak.#119, #120: Remove _config attribute from
icat.config.Configuration
.#115, #116: Fix the test suite to work if either PyYAML or lxml is not available.
#128: Return an empty list from
icat.dump_queries.getDataPublicationQueries()
when talking to an ICAT server older than 5.0.#117: Fixed deprecation warnings from upcoming Python 3.12.
#129: Review the build of the documentation at Read the Docs.
1.0.0 (2022-12-21)
New features
#102, #104: Make the obj argument to
icat.client.Client.new()
case insensitive.#77, #103: Add a keyword argument preset to allow directly passing configuration values to the constructor of class
icat.config.Config
.#66, #75: Add pathlib support: methods that take a file name argument also accept a
pathlib.Path
object. Internal representation of file system paths are changed to usepathlib.Path
where appropriate. The predefined configuarion variable configFile now supports tilde expansion. Note incompatible changes below.#74:
icat.ids.DataSelection
also accepts DataCollection as argument.
Incompatible changes and deprecations
The order and arrangement of data objects in the dump file created by icatdump has been changed. In some cases, older versions of icatingest will fail to read dump files written by new versions of icatdump.
As a consequence of switching to pathlib for file system paths some return values and variables are now
pathlib.Path
objects rather thenstr
. This affects:the return value of
icat.config.cfgpath()
,the predefined configuarion variable configFile,
the module variable
icat.config.cfgdirs
.
Drop support for Python 2 and Python 3.3.
Drop keyword argument attribute and method
icat.query.Query.setAttribute()
from classicat.query.Query
, deprecated in 0.18.0.Drop module
icat.cgi
, deprecated in 0.13.0.Drop module
icat.icatcheck
and exceptionicat.exception.GenealogyError
, deprecated in 0.17.0.Drop methods
icat.ids.IDSClient.resetPrepared()
,icat.ids.IDSClient.getPreparedDatafileIds()
,icat.ids.IDSClient.getPreparedData()
,icat.ids.IDSClient.getPreparedDataUrl()
,icat.client.Client.getPreparedData()
, andicat.client.Client.getPreparedDataUrl()
, deprecated in 0.17.0.Drop the predefined configuration variable configDir, deprecated in 0.13.0.
Drop helper function
icat.exception.stripCause()
, deprecated in 0.14.0.Deprecate
icat.config.defaultsection
. Use the new preset keyword argument toicat.config.Config
instead.
Bug fixes and minor changes
#98, #105: Review build tool chain. Add a helper class
icat.helper.Version
.#101: Fix tests failing with PyYAML 6.0.
Some (more) example scripts now require ICAT 4.4.0 or newer.
0.21.0 (2022-01-28)
New features
#100: Add read only attributes
icat.query.Query.select_clause
,icat.query.Query.join_clause
,icat.query.Query.where_clause
,icat.query.Query.order_clause
,icat.query.Query.include_clause
, andicat.query.Query.limit_clause
to access the respective clauses of the query string.
0.20.1 (2021-11-04)
Bug fixes and minor changes
#96: Fix failing build of the documentation at Read the Docs.
0.20.0 (2021-10-29)
New features
#86, #89: allow SQL functions to be used on the attributes in the arguments to
icat.query.Query.setOrder()
andicat.query.Query.addConditions()
.
Incompatible changes and new bugs
#94: the implementation of #89 changed the internal data structures in
icat.query.Query.conditions
andicat.query.Query.order
. These attributes are considered internal and are deliberately not documented, so one could argue that this is not an incompatible change. But the changes also have an impact on the return value oficat.query.Query.__repr__()
such that it is not suitable to recreate the query object.
Bug fixes and minor changes
#90, #91, #95:
icat.query.Query.join_specs
was not taken into account inicat.query.Query.copy()
andicat.query.Query.__repr__()
.
0.19.0 (2021-07-20)
New features
#85: add an argument join_specs to the constructor of class
icat.query.Query
and a corresponding methodicat.query.Query.setJoinSpecs()
to override the join specification to be used in the created query for selected related objects.
Bug fixes and minor changes
#83, #84: enable ordering on one to many relationships in class
icat.query.Query
.#84: Add warning classes
icat.exception.QueryOneToManyOrderWarning
andicat.exception.QueryWarning
, the latter being a common base class for warnings emitted during creation of a query.
0.18.1 (2021-04-13)
Bug fixes and minor changes
0.18.0 (2021-03-29)
New features
#76, #78: add client side support for searching for multiple fields introduced in icat.server 4.11.0. Add support for building the corresponding queries in the in class
icat.query.Query
.
Incompatible changes and deprecations
Since
icat.query.Query
now also accepts a list of attribute names rather then only a single one, the corresponding keyword argument attribute has been renamed to attributes (in the plural). Accordingly, the methodicat.query.Query.setAttribute()
has been renamed toicat.query.Query.setAttributes()
. The old names are retained as aliases, but are deprecated.
Bug fixes and minor changes
#79: fix an encoding issue in
icat.client.Client.apiversion
, only relevant with Python 2.#80: add
TypeError
as additional ancestor oficat.exception.EntityTypeError
.
0.17.0 (2020-04-30)
New features
#65: Add support for the extended IDS API calls
icat.ids.IDSClient.getSize()
andicat.ids.IDSClient.getStatus()
accepting a preparedId as introduced in ids.server 1.11.0. Also extend the methodsicat.ids.IDSClient.reset()
,icat.ids.IDSClient.getDatafileIds()
,icat.ids.IDSClient.getData()
,icat.ids.IDSClient.getDataUrl()
,icat.client.Client.getData()
, andicat.client.Client.getDataUrl()
to accept a preparedId in the place of a data selection.#63: Set a default path in the URL for ICAT and IDS respectively.
Incompatible changes and deprecations
Drop support for ICAT 4.2.*, deprecated in 0.13.0.
#61, #64: Review
icat.entities
. The entity classes from the ICAT schema are now dynamically created based on the information gathered with theicat.client.Client.getEntityInfo()
ICAT API call. Code that relied on the internals oficat.entities
such as the class hierarchy or that referenced any of the entity classes directly will need to be revisited. Note that common python-icat programs don’t need to do any of that. So it is assumed that most existing programs are not concerned.Deprecate
icat.ids.IDSClient.resetPrepared()
,icat.ids.IDSClient.getPreparedDatafileIds()
,icat.ids.IDSClient.getPreparedData()
,icat.ids.IDSClient.getPreparedDataUrl()
,icat.client.Client.getPreparedData()
, andicat.client.Client.getPreparedDataUrl()
. Call the corresponding methods without Prepared in the name with the same arguments instead.Deprecate support for Python 2 and Python 3.3.
Deprecate module
icat.icatcheck
. This module was not intended to be used in python-icat programs anyway.
Bug fixes and minor changes
#68: wipeicat enters an infinite loop if Datafiles are missing from IDS storage.
#62: Minor fixes in the error handling in setup.py.
Fix icatdata-4.10.xsd:
Study.endDate
was erroneously not marked as optional.#70: Fix several errors in the tests.
#58: Use specific test data for different ICAT versions.
#67, #71, #72: document the option to use suds-community instead of suds-jurko.
Misc
Do not include the documentation in the source distribution. Rely on the online documentation (see link in the README.rst) instead.
0.16.0 (2019-09-26)
New features
#59: Add support for sub-commands in
icat.config
.
Incompatible changes and deprecations
Drop support for Python 2.6.
Bug fixes and minor changes
#60: Fix bad coding style dealing with function parameters.
Use
setuptools_scm
to manage the version number.
0.15.1 (2019-07-12)
Bug fixes and minor changes
Issue #57:
icat.client.Client.searchChunked()
still susceptible to LIMIT clause bug in icat.server (Issue icatproject/icat.server#128).Call
yaml.safe_load()
rather thenyaml.load()
, fixing a deprecation warning from PyYAML 5.1.
0.15.0 (2019-03-27)
New features
#53: Add support for ICAT 4.10.0 including schema changes in that version.
Incompatible changes and deprecations
Require pytest 3.1.0 or newer to run the test suite. Note that this pytest version in turn requires Python 2.6, 2.7, or 3.3 and newer.
Drop support for Python 3.1 and 3.2. There is no known issue with these Python versions in python-icat (so far). But since we can’t test this any more, see above, we drop the claim to support them.
Bug fixes and minor changes
0.14.2 (2018-10-25)
Bug fixes and minor changes
Add a hook to control internal diverting of
sys.err
in theicat.config
module. This is intentionally not documented as it goes deeply into the internals of this module and most users will probably not need it.
0.14.1 (2018-06-05)
Bug fixes and minor changes
Fix a misleading error message if the IDS server returns an error for the Write API call.
0.14.0 (2018-06-01)
New features
#45: Add support for the IDS Write API call introduced in ids.server 1.9.0.
#46, #47: Add a
ìcat.client.Client.autoRefresh()
method. The scripts icatdump and icatingest call this method periodically to prevent the session from expiring.#48: Add support for an ordering direction qualifier in class
icat.query.Query
.#44: Add method
icat.entity.Entity.as_dict()
.#40: Add method
icat.client.Client.clone()
.
Incompatible changes and deprecations
Deprecate function
icat.exception.stripCause()
.This was an internal helper function not really meant to be part of the API. The functionality has been moved in a base class of the exception hierarchy.
Bug fixes and minor changes
Add the
icat.ids.IDSClient.version()
API call introduced in ids.server 1.8.0.#41: Incomprehensible error messages with Python 3.
#43:
icat.client.Client.logout()
should silently ignoreicat.exception.ICATSessionError
.Minor changes in the error handling. Add new exception
icat.exception.EntityTypeError
.Documentation fixes.
0.13.1 (2017-07-12)
Bug fixes and minor changes
#38: There should be a way to access the kwargs used to create the client in config.
0.13.0 (2017-06-09)
New features
#11: Support discovery of info about available ICAT authenticators.
If supported by the ICAT server (icat.server 4.9.0 and newer), the
icat.config
module queries the server for information on available authenticators and the credential keys they require for login. The configuration variables for these keys are then adapted accordingly. Note incompatible changes below.Review wipeicat. This was an example script, but is now promoted to be a regular utility script that gets installed.
#32: Add support for using aggregate functions in class
icat.query.Query
.#30: Add a predefined config variable type
icat.config.cfgpath()
.#31: Add a flag to add the default variables to the
icat.config.Config
constructor (default: True).icat.dumpfile_xml.XMLDumpFileReader
also accepts a XML tree object as input.Verify support for ICAT 4.9.0. Add new ICAT API method
icat.client.Client.getVersion()
.
Incompatible changes and deprecations
As a consequence of the discovery of available authenticators, the workflow during configuration need to be changed. Until now, the beginning of a typical python-icat program would look like:
config = icat.config.Config() # Optionally, add custom configuration variables: # config.add_variable(...) conf = config.getconfig() client = icat.Client(conf.url, **conf.client_kwargs)
E.g. first the configuration variables are set up, then the configuration is applied and finally the
icat.client.Client
object is created using the configuration values. With the discovery of authenticators, theicat.config.Config
object itself needs a workingicat.client.Client
object in order to connect to the ICAT server and query the authenticator info. Theicat.client.Client
object will now be created in theicat.config.Config
constructor and returned along with the configuration values byicat.config.Config.getconfig()
. You will need to replace the code from above by:config = icat.config.Config() # Optionally, add custom configuration variables: # config.add_variable(...) client, conf = config.getconfig()
The derived configuration variable client_kwargs that was used to pass additional arguments from the configuration to the Client constructor is no longer needed and has been removed.
The optional argument args has been moved from the
icat.config.Config.getconfig()
call to theicat.config.Config
constructor, retaining the same semantics. E.g. you must change in your code:config = icat.config.Config() conf = config.getconfig(args) client = icat.Client(conf.url, **conf.client_kwargs)
to:
config = icat.config.Config(args) client, conf = config.getconfig()
Deprecate support for ICAT 4.2.*.
Note that already now significant parts of python-icat require features from ICAT 4.3 such as the JPQL like query language. The only workaround is to upgrade your icat.server.
Deprecate module
icat.cgi
.It is assumed that this has never actually been used in production. For web applications it is recommended to use the Python Web Server Gateway Interface (WSGI) rather then CGI.
Deprecate the predefined configuration variable configDir.
The main use case for this variable was to be substituted in the default value for the path of an additional configuration file. The typical usage was the definition of a configuration variable like:
config = icat.config.Config() config.add_variable('extracfg', ("--extracfg",), dict(help="Extra config file"), default="%(configDir)s/extra.xml", subst=True)
This set the default path for the extra config file to the same directory the main configuration file was found in. Using the new config variable type
icat.config.cfgpath()
you can replace this by:config = icat.config.Config() config.add_variable('extracfg', ("--extracfg",), dict(help="Extra config file"), default="extra.xml", type=icat.config.cfgpath)
This will search the extra config file in all the default config directories, regardless where the main configuration file was found.
The fixes for #35 and #36 require some changes in the semantics in the f and the mode argument to
icat.dumpfile.open_dumpfile()
. Most users will probably not notice the difference.
Bug fixes and minor changes
Changed the default for the
icat.config.Config
constructor argument ids fromFalse
to"optional"
.Improved
icat.client.Client.searchChunked()
. This version is not susceptible to Issue icatproject/icat.server#128 anymore.Move the management of dependencies of tests into a separate package pytest-dependency that is distributed independently.
#34:
TypeError
in theicat.client.Client
constructor if setting the sslContext keyword argument.#35:
io.UnsupportedOperation
is raised ificat.dumpfile.open_dumpfile()
is called with an in-memory stream.#36:
icat.dumpfile.DumpFileReader
andicat.dumpfile.DumpFileWriter
must not close file.#37:
TypeError
is raised when writing a YAML dumpfile toio.StringIO
.
0.12.0 (2016-10-10)
New features
Verify support for ICAT 4.8.0 and IDS 1.7.0.
Add methods
icat.ids.IDSClient.reset()
andicat.ids.IDSClient.resetPrepared()
.#28: Add support for searching for attributes in class
icat.query.Query
.
Bug fixes and minor changes
Sort objects in icatdump before writing them to the dump file. This keeps the order independent from the collation used in the ICAT database backend.
#2: for Python 3.6 (expected to be released in Dec 2016) and newer, use the support for chunked transfer encoding in the standard lib. Keep our own implementation in module
icat.chunkedhttp
only for compatibility with older Python versions.Improved the example script wipeicat.
Add an example script dumprules.py.
Add missing schema definition for the ICAT XML data file format for ICAT 4.7.
Fix an
AttributeError
during error handling.
0.11.0 (2016-06-01)
New features
Incompatible changes
Remove the autoget argument from
icat.entity.Entity.getUniqueKey()
. Deprecated since 0.9.0.
Bug fixes and minor changes
#21: configuration variable promptPass is ignored when set in the configuration file.
#18: Documentation: missing stuff in the module index.
#20: add test on compatibility with icat.server.
#24, #25: test failures caused by different timezone settings of the test server.
Use a separate module distutils_pytest to run the tests from setup.py.
icat.icatcheck
: move checking of exceptions into a separate methodicat.icatcheck.ICATChecker.checkExceptions()
. Do not report exceptions defined in the client, but not found in the schema.Many fixes in the example script wipeicat.
Fix a missing import in the icatexport.py example script.
Somewhat clearer error messages for some special cases of
icat.exception.SearchAssertionError
.
Misc
Change license to Apache 2.0.
0.10.0 (2015-12-06)
New features
Add a method
icat.entity.Entity.copy()
.Implement setting an INCLUDE 1 clause equivalent in class
icat.query.Query
.Add an optional argument includes to
icat.client.Client.searchMatching()
.Add a hook for a custom method to validate entity objects before creating them at the ICAT server.
Add support for ids.server 1.5.0:
Add
icat.ids.IDSClient.getDatafileIds()
andicat.ids.IDSClient.getPreparedDatafileIds()
calls.icat.ids.IDSClient.getStatus()
allows sessionId to be None.
Add new exception class
icat.exception.ICATNotImplementedError
that is supposed to be raised by the upcoming version 4.6.0 of icat.server.
Bug fixes and minor changes
#13:
icat.client.Client.searchChunked()
raises exception if the query contains a percent character.#15: icatdump raises
icat.exception.DataConsistencyError
for DataCollectionParameter.#14:
icat.entity.Entity.__sortkey__()
may raiseRuntimeError
“maximum recursion depth exceeded”.Allow a
icat.ids.DataSelection
to be created from (almost) any Iterator, not just aSequence
. Store the object ids inicat.ids.DataSelection
internally in aset
rather then alist
.Add optional arguments objindex to
icat.dumpfile.DumpFileReader.getobjs()
and keyindex toicat.dumpfile.DumpFileWriter.writedata()
to allow the caller to control these internal indices.Add optional argument chunksize to
icat.dumpfile.DumpFileWriter.writedata()
.The constructor of class
icat.query.Query
checks the version of the ICAT server and raises an error if too old.The
icat.ids.IDSClient.getIcatUrl()
call checks the version of the IDS server.Some changes in the test suite, add more tests.
0.9.0 (2015-08-13)
New features
#4: Extend icatrestore to become a generic ingestion tool.
Rename icatrestore to icatingest.
Allow referencing of objects by attribute rather then by unique key in the input file for icatingest (only in the XML backend).
Allow adding references to already existing objects in the input file for icatingest (only in the XML backend).
Change the name of the root element in the input file for icatingest (and the output of icatdump) from icatdump to icatdata (only in the XML backend).
Implement upload of Datafiles to IDS rather then only creating the ICAT object from icatingest.
Implement handling of duplicates in icatingest. The same options (THROW, IGNORE, CHECK, and OVERWRITE) as in the import call in the ICAT restful interface are supported.
#1: add a test suite.
#3: use Sphinx to generate the API documentation.
Add method
icat.client.Client.searchMatching()
.Add the
icat.ids.IDSClient.getIcatUrl()
call introduced with IDS 1.4.0.
Incompatible changes and deprecations
The Lucene calls that have been removed in ICAT 4.5.0 are also removed from the client.
Deprecate the use of the autoget argument in
icat.entity.Entity.getUniqueKey()
.
Bug fixes and minor changes
#6:
icat.query.Query
: adding a condition on a meta attribute fails.#10: client.putData: IDSInternalError is raised if datafile.datafileCreateTime is set.
Ignore import errors from the backend modules in icatingest and icatdump. This means one can use the scripts also if the prerequisites for some backends are not fulfilled, only the concerned backends are not available then.
#5, compatibility with ICAT 4.5: entity ids are not guaranteed to be unique among all entities, but only for entities of the same type.
#5, compatibility with ICAT 4.5:
icat.client.Client.getEntityInfo()
also lists createId, createTime, modId, and modTime as attributes. This need to be taken into account inicat.icatcheck
.The last fix in 0.8.0 on the string representation operator
icat.query.Query.__str__()
was not complete, the operator still had unwanted side effects.Fix a bug in the handling of errors raised from the ICAT or the IDS server. This bug affected only Python 3.
Add proper type checking and conversion for setting an attribute that corresponds to a one to many relationship in class
icat.entity.Entity
. Accept any iterable of entities as value.#9: icatingest with duplicate=CHECK may fail when attributes are not strings. Note that this bug was only present in an alpha version, but not in any earlier release version.
Source repository moved to Git. This gives rise to a few tiny changes. To name the most visible ones: python2_6.patch is now auto generated by comparing two source branches and must be applied with -p1 instead of -p0, the format of the icat module variable
icat.__revision__
has changed.Review default exports of modules. Mark some helper functions as internal.
0.8.0 (2015-05-08)
New features
Enable verification of the SSL server certificate in HTTPS connections. Add a new configuration variable checkCert to control this. It is set to
True
by default.Note that this requires either Python 2.7.9 or 3.2 or newer. With older Python version, this configuration option has no effect.
Add type conversion of configuration variables.
Add substituting the values of configuration variables in other variables.
Add another derived configuration variable configDir.
Default search path for the configuration file: add an appropriate path on Windows, add
/etc/icat
and~/.config/icat
to the path if not on Windows.Add icatexport.py and icatimport.py example scripts that use the corresponding calls to the ICAT RESTful interface to dump and restore the ICAT content.
The constructor of
icat.exception.ICATError
and theicat.exception.translateError()
function are now able to construct exceptions based on a dict such as those returned by the ICAT RESTful interface in case of an error.Unified handling of errors raised from the ICAT and the IDS server.
Incompatible changes
As a consequence of the unified handling of errors, the exception class hierarchy has been reviewed, with a somewhat more clear separation of exceptions raised by other libraries, exceptions raised by the server, and exceptions raised by python-icat respectively.
If you put assumptions on the exception hierarchy in your code, this might need a review. In particular,
icat.exception.IDSResponseError
is not derived fromicat.exception.IDSError
any more.icat.exception.IDSServerError
has been removed.I.e., replace all references to
icat.exception.IDSServerError
byicat.exception.IDSError
in your code. Furthermore, if you catchicat.exception.IDSError
in your code with the intention to catch both, errors from the IDS server andicat.exception.IDSResponseError
in one branch, replace:try: # ... except IDSError: # ...
by
try: # ... except (IDSError, IDSResponseError): # ...
Bug fixes and minor changes
The
icat.query.Query
class now checks the attributes referenced in conditions and includes for validity.Fix a regression introduced with version 0.7.0 that caused non-ASCII characters in queries not to work.
Fix
icat.exception.ICATError
andicat.exception.IDSError
to gracefully deal with non-ASCII characters in error messages. Add a common abstract base classicat.exception.ICATException
that cares about this.Fix: the string representation operator
icat.query.Query.__str__()
should not modify the query object.Cosmetic improvement in the formal representation operator
icat.query.Query.__repr__()
.
0.7.0 (2015-02-11)
New features
Add a module
icat.query
with a classicat.query.Query
that can be used to build ICAT search expressions. Instances of the class may be used in place of search expression strings where appropriate.Numerous examples on how to use this new class can be found in querytest.py in the examples.
Add a class method
icat.entity.Entity.getNaturalOrder()
that returns a list of attributes suitable to be used in an ORDER BY clause in an ICAT search expression.Add a class method
icat.entity.Entity.getAttrInfo()
that queries the EntityInfo from the ICAT server and extracts the information on an attribute.Add a method
icat.client.Client.getEntityClass()
that returns theicat.entity.Entity
subclass corresponding to a name.Add a warning class
icat.exception.QueryNullableOrderWarning
.Add an optional argument username to the
icat.ids.IDSClient.getLink()
method.
0.6.0 (2014-12-15)
New features
Add support for ICAT 4.4.0: add new
icat.entity.Entity
type InvestigationGroup, role has been added to the constraint in InvestigationUser.Add new API method
icat.ids.IDSClient.getApiVersion()
that will be introduced with the upcoming version 1.3.0 of IDS. This method may also be called with older IDS servers: if it is not available because the server does not support it yet, the server version is guessed from visible features in the API.icat.ids.IDSClient
checks the API version on init.Add new API methods
icat.ids.IDSClient.isReadOnly()
,icat.ids.IDSClient.isTwoLevel()
,icat.ids.IDSClient.getLink()
, andicat.ids.IDSClient.getSize()
introduced with IDS 1.2.0.Add no_proxy support. The proxy configuration variables, http_proxy, https_proxy, and no_proxy are set in the environment. [Suggested by Alistair Mills]
Rework the dump file backend API for icatdump and icatrestore. As a result, writing custom dump or restore scripts is much cleaner and easier now.
This may cause compatibility issues for users who either wrote their own dump file backend or for users who wrote custom dump or restore scripts, using the XML or YAML backends. In the first case, compare the old XML and YAML backends with the new versions and you’ll easily see what needs to get adapted. In the latter case, have a look into the new versions of icatdump and icatrestore to see how to use the new backend API.
Add method
icat.client.Client.searchChunked()
.Add method
icat.entity.Entity.getAttrType()
.
Incompatible changes
Move the group argument to method
icat.client.Client.createRules()
to the last position and make it optional, having defaultNone
.In the client code, replace:
client.createRules(group, crudFlags, what)
by
client.createRules(crudFlags, what, group)
The
icat.client.Client.putData()
method returns the new Datafile object created by IDS rather then only its id.If you depend on the old behavior in the client code, replace:
dfid = client.putData(file, datafile)
by
df = client.putData(file, datafile) dfid = df.id
Minor changes and fixes
The
icat.client.Client.searchText()
andicat.client.Client.luceneSearch()
client method have been deprecated. They are destined to be dropped from the ICAT server or at least changed in version 4.5.0 and might get removed from python-icat in a future release as well.The methods now emit a deprecation warning when called. Note however that Python by default ignores deprecation warnings, so you won’t see this unless you switch them on.
Fixed overly strict type checking in the constructor arguments of
icat.ids.DataSelection
and as a consequence also in the arguments of the ICAT client methodsicat.client.Client.getData()
,icat.client.Client.getDataUrl()
,icat.client.Client.prepareData()
, andicat.client.Client.deleteData()
: now, anySequence
of entity objects will be accepted, in particular anicat.entity.EntityList
.Change
icat.ids.IDSClient.archive()
andicat.ids.IDSClient.restore()
to not to return anything. While formally, this might be considered an incompatible change, these methods never returned anything meaningful in the past.Slightly modified the == and != operator for
icat.entity.Entity
. Add aicat.entity.Entity.__hash__()
method. The latter means that you will more likely get what you expect when you create a set oficat.entity.Entity
objects or use them as keys in a dict.The module
icat.eval
now only does its work (parsing command line arguments and connecting to an ICAT server) when called from the Python command line. When imported as a regular module, it will essentially do nothing. This avoids errors to occur when imported.setup.py raises an error with Python 2.6 if python2_6.patch has not been applied.
Add missing MANIFEST.in in the source distribution.
Remove the work around the Suds datetime value bug (setting the environment variable TZ to
UTC
) fromicat
. Instead, document it along with other known issues in the README.Minor fixes in the sorting of entity objects.
Add an optional argument args to
icat.config.Config.getconfig()
. If set to a list of strings, it replacessys.argv
. Mainly useful for testing.Add comparison operators to class
icat.listproxy.ListProxy
.
0.5.1 (2014-07-07)
Add a module
icat.eval
that is intended to be run using the-m
command line switch to Python. It allows to evaluate Python expressions within an ICAT session as one liners directly from the command line, as for example:# get all Dataset ids $ python -m icat.eval -e 'client.search("Dataset.id")' -s root [102284L, 102288L, 102289L, 102293L]
Fix an issue in the error handling in the IDS client that caused an
urllib2.HTTPError
to be raised instead of anicat.exception.IDSServerError
in the case of an error from the IDS server and thus the loss of all details about the error reported in the reply from the server.Add specific exception classes for the different error codes raised by the IDS server.
Fix compatibility issue with Python 3.3 that caused the HTTP method to be set to
None
in some IDS methods, which in turn caused an internal server error to be raised in the IDS server.Fix compatibility issues with Python 3.4: some methods have been removed from class
urllib.request.Request
which caused anAttributeError
in theicat.ids.IDSClient
.Fix: failed to connect to an ICAT server if it advertises a version number having a trailing “-SNAPSHOT” in
icat.client.Client.getApiVersion()
. For compatibility, a trailing “-SNAPSHOT” will be replaced by “a1” in the client.apiversion attribute.Suppress misleading context information introduced with Python 3 (PEP 3134) from the traceback in some error messages. Unfortunately, the fix only works for Python 3.3 and newer.
Make example files compatible across Python versions without modifications, such as running 2to3 on them.
0.5.0 (2014-06-24)
Integrate an IDS client in the ICAT client.
Improved icatdump and icatrestore:
Changed the logical structure of the dump file format which significantly simplified the scripts. Note that old dump files are not compatible with the new versions.
Add support for XML dump files. A XML Schema Definition for the dump file format is provided in the doc directory.
The scripts are now considered to be legitimate tools (though still alpha) rather then mere examples. Consequently, they will be installed into the bin directory.
Implicitly set a one to many relation to an empty list if it is accessed but not present in an
icat.entity.Entity
object rather then raising anAttributeError
. See ICAT Issue 112.Allow setting one to many relationship attributes and deletion of attributes in
icat.entity.Entity
. Add methodicat.entity.Entity.truncateRelations()
. Truncate dummy relations set by the factory in newly created entity objects.Cache the result from
icat.client.Client.getEntityInfo()
in the client.Add a method
icat.entity.Entity.__sortkey__()
that return a key that when used as a sorting key inlist.sort()
allows any list of entity objects to have a well defined order. Sorting is based on the Constraint attributes. Add a class variableicat.entity.Entity.SortAttrs
that overrides this and will be set as a fall back for those entity classes that do not have a suitable Constraint.
0.4.0 (2014-02-11)
Add support for the jurko fork of Suds and for Python 3.
Add a new method
icat.client.Client.searchUniqueKey()
.Add an optional argument keyindex to method
icat.entity.Entity.getUniqueKey()
that is used as a cache of previously generated keys. Remove the argument addbean. It had been documented as for internal use only, so this is not considered an incompatible change.Add a new exception
icat.exception.DataConsistencyError
. Raise this inicat.entity.Entity.getUniqueKey()
if a relation that is required in a constraint is not set.Rename
icat.exception.SearchResultError
toicat.exception.SearchAssertionError
. SearchResultError was a misnomer here, as this exception class is very specific toicat.client.Client.assertedSearch()
. Add a new generic exception classicat.exception.SearchResultError
and deriveicat.exception.SearchAssertionError
from it. This way, the change should not create any compatibility problems in client programs.Add a check in
icat.icatcheck
that theicat.exception.ICATError
subclasses are in sync with icatExceptionType as defined in the schema.Bugfix: The code dealing with exceptions raised by the ICAT server did require all attributes in IcatException sent by the server to be set, although some of these attributes are marked as optional in the schema.
Do not delete the Suds cache directory in
icat.client.Client.cleanup()
.Installation: python-icat requires Python 2.6 or newer. Raise an error if setup.py is run by a too old Python version.
Move some internal routines in a separate module
icat.helper
.Greatly improved example scripts icatdump and icatrestore.
0.3.0 (2014-01-10)
Add support for ICAT 4.3.1. (Compatibility with ICAT 4.3.2 has also been tested but did not require any changes.)
Implement alias names for entity attributes. This facilitates compatibility of client programs to different ICAT versions. E.g. a client program may use rule.grouping regardless of the ICAT version, for ICAT 4.2.* this is aliased to rule.group.
Add a method
icat.client.Client.assertedSearch()
.Add a method
icat.entity.Entity.getUniqueKey()
.Add entity methods
Group.getUsers()
andInstrument.getInstrumentScientists()
.WARNING, incompatible change!
Changed entity methods
Instrument.addInstrumentScientist()
andInvestigation.addInvestigationUser()
to not to create the respective user any more, but rather expect a list of existing users as argument. RenamedGroup.addUser()
,Instrument.addInstrumentScientist()
, andInvestigation.addInvestigationUser()
toaddUsers()
,addInstrumentScientists()
, andaddInvestigationUsers()
(note the plural “s”) respectively.In the client code, replace:
pi = investigation.addInvestigationUser(uid, fullName=userName, search=True, role="Principal Investigator")
by
pi = client.createUser(uid, fullName=userName, search=True) investigation.addInvestigationUsers([pi], role="Principal Investigator")
Work around a bug in the way SUDS deals with datetime values: set the local time zone to
UTC
.Add example scripts icatdump and icatrestore.
0.2.0 (2013-11-18)
Rework internals of
icat.config
.Bugfix:
icat.config.Config
required a password to be set even if prompt for password was requested.Add support for configuration via environment variables.
Add support of HTTP proxy settings. [Suggested by Alistair Mills]
WARNING, incompatible change! The configuration read by
icat.config
is not stored as attributes on theicat.config.Config
object itself, but rathericat.config.Config.getconfig()
returns an object with these attributes set. This keeps the configuration values cleanly separated from the attributes of theicat.config.Config
object.In the client code, replace:
conf = icat.config.Config() conf.getconfig()
by
config = icat.config.Config() conf = config.getconfig()
Move
ConfigError
fromicat.config
toicat.exception
.Move
GenealogyError
fromicat.icatcheck
toicat.exception
.Review export of symbols. Most client programs should only need to import
icat
andicat.config
.
0.1.0 (2013-11-01)
Initial version