Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Gaudi Gaudi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 124
    • Issues 124
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 35
    • Merge requests 35
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GaudiGaudi
  • GaudiGaudi
  • Issues
  • #219
Closed
Open
Issue created Mar 17, 2022 by Marco Clemencic@clemenciOwner

Rationalize property values serialization and deserialization

While trying to use a custom property looking like

using MyPropType = std::vector<SomeValueType>;
std::ostream& operator<<(std::ostream& s, const SomeValueType& v) {
  return s << "value[" << ... << "]";
}
class MyAlg: ... {
  Gaudi::Property<MyPropType> m_prop{...};
}

I wanted to represent it in Python as a vector of strings so I used Gaudi::Details::Property::StringConverter template specializations to control how the default values of the property was serialized for configurables, but I realized that genconf serializes anything that is not explicitly handles using PropertyBase::toStream (and commenting that it is a list) instead of PropertyBase::toString.

In a normal case this is not a problem as by default toString is implemented in terms of toStream, and it is not a problem in my case as the default value an empty list, but in general terms there is an inconsistency.

What I think we need (as already mentioned a few times) is a Python-like separation between conversion to string (for printing) and representation (as a mean of serializing the value to valid Python code).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking