Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation on I/O #267

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

m-fila
Copy link
Contributor

@m-fila m-fila commented Dec 17, 2024

BEGINRELEASENOTES

  • Added documentation for reading and writing EDM4hep files with the IOSvc
  • Moved documentation on k4DataSvc to legacy page

ENDRELEASENOTES

Some extensions (namely sphinx-design and from myst_parser colon_fence) are used to render the pages more nicely in sphinx-based documentation with admonitions and tabs (setting properties either in steering file or from command line):
image

Closes #212


evtSvc = k4DataSvc("EventDataSvc")
io_svc = IOSvc("IOSvc")
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if we need / want to mention this explicitly in the documentation but I think "IOSvc" is pretty much required as name for the IOSvc, right? At least some of the CLI examples below will only work with that. Can we create an empty IOSvc() and rely on a default name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a mention:

The service should be imported from k4FWCore and named "IOSvc" as other components may look for it under this name.

Yes, naming it differently might be a problem. Relaying on the default name works fine.
Added a comment

Algorithm to write data to an output file on disk.
### EventHeaderCreator

Algorithm creating new `edm4hep::EventHeaderCollection` data object.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Algorithm creating new `edm4hep::EventHeaderCollection` data object.
Algorithm creating a new `edm4hep::EventHeaderCollection` data object.

:::{caution}
`k4DataSvc` is a legacy service previously used in K4FWCore for reading and writing data in EDM4hep or other data models based on PODIO.

The currently used service is `IOSvc`, which offers improved streamlined functionality and better support for modern workflows. For detailed documentation on `IOSvc`, refer to [this documentation](IO.md).
Copy link
Member

Choose a reason for hiding this comment

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

But there isn't an IO.md?


The k4FWCore provides the `MetadataSvc` that allows accessing user metadata in PODIO-based data-models. There is no need to instantiate the `MetadataSvc` explicitly when using `IOSvc` as `IOSvc` can instantiate it on its own if needed.

When both `Input` and `Output` properties of `IOSvc` are defined, all the metadata originally present in the input will be propagated to the output, possibly adding also any user metadata created during processing.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
When both `Input` and `Output` properties of `IOSvc` are defined, all the metadata originally present in the input will be propagated to the output, possibly adding also any user metadata created during processing.
When both the `Input` and `Output` properties of `IOSvc` are defined, all the metadata originally present in the input will be propagated to the output, possibly adding also any user metadata created during processing.

@@ -1,25 +1,40 @@
# k4FWCore (key4hep FrameWork Core)

k4FWCore is a Gaudi package that provides the PodioDataService, which allows to
k4FWCore is a Gaudi package that provides the IOSvc, which allows to
use podio-based event data models like EDM4hep in Gaudi workflows.
Copy link
Member

Choose a reason for hiding this comment

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

In several places this line is used "podio-based ... like EDM4hep". We should probably just say EDM4hep; I'm not sure stuff will work with any other podio-based EDM.


```python
from Configurables import PodioInput, k4DataSvc
The `IOSvc` supports reading ROOT files containing PODIO-based data-models such as EDM4hep. Both files written with ROOT TTree or RNTuple backend are supported with the backend inferred automatically from the files themselves.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The `IOSvc` supports reading ROOT files containing PODIO-based data-models such as EDM4hep. Both files written with ROOT TTree or RNTuple backend are supported with the backend inferred automatically from the files themselves.
The `IOSvc` supports reading ROOT files containing PODIO-based data-models such as EDM4hep. Both files written with the ROOT TTree or RNTuple backend are supported with the backend inferred automatically from the files themselves.

Comment on lines +233 to +234
The biggest challenge for the transition are the algorithms and services that explicitly request and operate on `PodioDataSvc`. These components are not compatible with `IOSvc` and their internals have to be adapted for the usage with `IOSvc` case by case.

Copy link
Member

Choose a reason for hiding this comment

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

I had a look and it's only used in k4SimDelphes and k4MarlinWrapper. I'm not sure if this paragraph is useful in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the documentation for reading / writing collections using IOSvc
3 participants