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

New python module creation syntax does not work well with xor of types #47086

Open
makortel opened this issue Jan 10, 2025 · 4 comments
Open

Comments

@makortel
Copy link
Contributor

Noticed in #47085 e.g.

import FWCore.ParameterSet.Config as cms

process = cms.Process("Test")
from IOPool.Input.modules import PoolSource
process.source = PoolSource(
    fileNames = "nonexistent.root",
    firstEvent = 2**32
)

or

import FWCore.ParameterSet.Config as cms

process = cms.Process("Test")
from IOPool.Input.modules import PoolSource
process.source = PoolSource(
    fileNames = "nonexistent.root",
    firstEvent = cms.uint64(2**32)
)

fail with

TypeError: addUInt32(): incompatible function arguments. The following argument types are supported:
    1. (self: libFWCorePythonParameterSet.ParameterSet, arg0: bool, arg1: str, arg2: int) -> None

or

TypeError: Attempted to assign type <class 'FWCore.ParameterSet.Types.uint64'> to type <class 'FWCore.ParameterSet.Types.uint32'>

, respectively, when run through cmsRun.

PoolSource uses this fillDescriptions for the firstEvent

desc.addNode(edm::ParameterDescription<unsigned int>("firstEvent", 1U, false) xor
edm::ParameterDescription<unsigned long long>("firstEvent", 1ULL, false))

The module generator function uses the unsigned int variant, and makes the use of the other type impossible with the new syntax.

@makortel
Copy link
Contributor Author

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@makortel,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

cms-bot internal usage

@cmsbuild
Copy link
Contributor

A new Issue was created by @makortel.

@Dr15Jones, @antoniovilela, @makortel, @mandrenguyen, @rappoccio, @sextonkennedy, @smuzaffar can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

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

No branches or pull requests

2 participants