Skip to content

Commit 80114d7

Browse files
committed
Avoid to invoke logging.info before calling logging.basicConfig.
When we call logging.info before calling logging.basicConfig, logging.basicConfig may fail, so in the previous code, if our electron number is missing, we would see an empty logging. So this commit does not logging the information about missing electron number instead to save the logging basic config.
1 parent 73867d5 commit 80114d7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

qmb/hubbard.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ModelConfig:
2929
# The coefficient of U
3030
u: typing.Annotated[float, tyro.conf.arg(aliases=["-u"])] = 0
3131

32-
# The electron number
32+
# The electron number, left empty for half-filling
3333
electron_number: typing.Annotated[int | None, tyro.conf.arg(aliases=["-e"])] = None
3434

3535
# The ref energy of the model
@@ -38,7 +38,6 @@ class ModelConfig:
3838
def __post_init__(self) -> None:
3939
if self.electron_number is None:
4040
self.electron_number = self.m * self.n
41-
logging.info("Electron number is not specified, set to half-filling (one electron per lattice site) %d", self.electron_number)
4241

4342
if self.m <= 0 or self.n <= 0:
4443
raise ValueError("The dimensions of the Hubbard model must be positive integers.")

0 commit comments

Comments
 (0)