Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

Add Seiscomp scml0.14 compatibility, migrate code from sc3ml to scml#3651

Open
filefolder wants to merge 12 commits intoobspy:masterfrom
filefolder:scxml0.14
Open

Add Seiscomp scml0.14 compatibility, migrate code from sc3ml to scml#3651
filefolder wants to merge 12 commits intoobspy:masterfrom
filefolder:scxml0.14

Conversation

@filefolder
Copy link
Contributor

@filefolder filefolder commented Dec 5, 2025

What does this PR do?

Adds read/write capability for the new Seiscomp 7.0.0 0.14 schema

There was a big shift on this release from using "sc3ml" to just "scml" which required a bit of juggling. Accordingly re-wrote a lot of code references from "sc3ml" to "scml" including adding the option to use SCML as a format option, keeping SC3ML in for backwards compatibility (should add a depreciation warning though).

Refreshes the published XSL files for all versions which usually is a great improvement on reading and writing. However there was a change/bugfix in their published XSL on 26.07.2024 regarding the confidence ellipsoids were calculated, seems they were off by 1000x due to a kilometer/meter mix-up. This was fixed from 0.10 on (which I believe was SC 3 or 4?) but not in 0.9 and below, so I had to skip testing on those. Some test data also had to be updated to suit. The older "wrong" versions of the XSL remain for legacy reasons (matching what is still included in SC) but I did drop 0.6 support as it was causing additional problems and is thoroughly decrepit. Users can always dig up the XLS files and do this manually if needed.

Another feature that I think was missing is the option to save SCML to whichever version you like. By default it is 0.12 which from memory is the last sort of significant update and should be compatible with versions 5+.

I have added a few 0.14 tests but nothing that tests any of the more esoteric event types. As the changes from 0.13 are fairly small I don't envision anything weird happening.

I think important to have out for 1.5 ...

@filefolder filefolder mentioned this pull request Dec 5, 2025
22 tasks
@filefolder filefolder added .io.sc3ml ready for review PRs that are ready to be reviewed to get marked ready to merge labels Dec 5, 2025
@ThomasLecocq
Copy link
Contributor

Solid work again @filefolder ! Thanks! and indeed, needed for 1.5.0.

We should get some seiscomp guys check this PR too: @gempa-jabe @gempa-dirk could you have a look here ? It'd be cool to have your input ! 🥳

Copy link

@gempa-dirk gempa-dirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For style sheet conversion you may simply consider the files in https://github.com/SeisComP/common/blob/master/libs/xml/ in order to drop a line-by-line review.

@ThomasLecocq
Copy link
Contributor

should there be some kind of DeprecationWarning to the SC3ML -> SCML format ?

@filefolder
Copy link
Contributor Author

That was my intent but I am actually not too sure how to implement. Simple way could be (core/event/catalog.py and core/inventory/inventory.py)

        if format == 'SC3ML':
            msg = "'SC3ML' will be depreciated soon, use 'SCML'"
            print(msg)

I am aware of from obspy.core.util.deprecation_helpers import ObsPyDeprecationWarning but I don't understand how or if it works.

@filefolder
Copy link
Contributor Author

OK, have rebased and added a deprecation warning (which actually manually changes format instances of SC3ML directly to SCML and removed it as an option)

cat = obspy.read_events('cat.scxml',format='SC3ML')
/usr/local/lib/python3.13/site-packages/obspy/core/util/decorator.py:209: ObsPyDeprecationWarning: Format 'SC3ML' is deprecated since ObsPy 1.5.0 and will be removed in a future release. Use 'SCML' instead.
  result = func(filename, *args, **kwargs)

@gempa-dirk
Copy link

For style sheet conversion you may simply consider the files in https://github.com/SeisComP/common/blob/master/libs/xml/ in order to drop a line-by-line review.

If you have considered my previous recommendation, then I have no further comments.

@filefolder
Copy link
Contributor Author

For style sheet conversion you may simply consider the files in https://github.com/SeisComP/common/blob/master/libs/xml/ in order to drop a line-by-line review.

If you have considered my previous recommendation, then I have no further comments.

Thanks Dirk, yes they're the same files. I think I replied to one of the code comments.

@filefolder filefolder dismissed gempa-dirk’s stale review January 13, 2026 01:39

have addressed everything- thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.io.sc3ml .io.seiscomp ready for review PRs that are ready to be reviewed to get marked ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants