Conversation
yomichi
commented
Mar 13, 2026
- do refactoring SetConfig
- add documents
- Harden load(): raise FileNotFoundError when file missing, ValueError for missing sections or unknown learning method - Replace SafeConfigParser with ConfigParser, use has_section/get instead of _sections - Extend boolean() to accept true/false, 1/0, yes/no, on/off (case-insensitive) - Unify defaults: Online max_epoch 500, Adam gamma 0.999 (init and load) - Add optional config arg to Search, Learning, Batch, Online, Adam constructors; SetConfig.load() builds via Search(config) and Adam(config)/Batch(config) - Update example to use SetConfig() instead of deprecated set_config() - Add unit tests for load() success/failure and boolean(); update docs Made-with: Cursor
- Added `setconfig.rst` documentation in both English and Japanese, detailing the usage and configurable parameters for `physbo.SetConfig`. - Updated the index files to include links to the new `setconfig` documentation in both language sections.
There was a problem hiding this comment.
Pull request overview
Refactors PHYSBO’s SetConfig configuration loading to use configparser.ConfigParser, add stricter validation/error handling, and introduces new Sphinx documentation plus unit tests around config parsing.
Changes:
- Refactor
SetConfig/Search/Learningclasses to support initialization from aConfigParserand improve error handling for missing files/sections and unknown learning methods. - Add unit tests covering config file loading and boolean parsing behavior.
- Add English/Japanese Sphinx docs for SetConfig and update docs build script to support selecting languages.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_misc.py | Adds unit tests for SetConfig.load() scenarios and boolean() parsing. |
| src/physbo/misc/_set_config.py | Refactors config parsing, adds required-section checks, improves boolean parsing, and adds config_file init option. |
| examples/gaussian_process/simple.py | Updates example to instantiate SetConfig directly. |
| docs/sphinx/manual/ja/source/setconfig.rst | Adds Japanese SetConfig documentation page. |
| docs/sphinx/manual/ja/source/index.rst | Adds the new SetConfig page to the manual toctree. |
| docs/sphinx/manual/en/source/setconfig.rst | Adds English SetConfig documentation page. |
| docs/sphinx/manual/en/source/index.rst | Adds the new SetConfig page to the manual toctree. |
| docs/make_docs.sh | Allows selecting which languages to build and validates language args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…gle defaults - Rename sections [online], [adam], [batch] to [learning.online], [learning.adam], [learning.batch]; support old names with DeprecationWarning - Make all sections optional: skip missing sections and use defaults - Use instance attributes as get() defaults in load() so defaults are defined only in __init__; set subclass attributes before super().__init__ so load() sees them when called from parent Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Refactors physbo.misc.SetConfig configuration loading to use configparser.ConfigParser, support hierarchical INI sections ([learning.*]), and adds tests + Sphinx documentation describing configuration options.
Changes:
- Refactor
SetConfig/Search/Learningconfig parsing, including deprecated fallback for legacy section names withDeprecationWarning. - Add unit tests covering config loading paths (adam/batch, defaults, deprecated sections, missing file) and a stricter boolean parser.
- Add EN/JA Sphinx docs page for SetConfig, link it from the manual index, update an example, and enhance the docs build script to accept language args.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test_misc.py | Adds unit tests for SetConfig loading behavior and boolean parsing. |
| src/physbo/misc/_set_config.py | Implements the SetConfig refactor: hierarchical sections, defaults, deprecation warnings, improved boolean parsing. |
| examples/gaussian_process/simple.py | Updates example to instantiate physbo.misc.SetConfig() instead of deprecated helper. |
| docs/sphinx/manual/ja/source/setconfig.rst | Adds Japanese SetConfig documentation (usage + INI parameters). |
| docs/sphinx/manual/ja/source/index.rst | Links the new setconfig page from the JA manual index. |
| docs/sphinx/manual/en/source/setconfig.rst | Adds English SetConfig documentation (usage + INI parameters). |
| docs/sphinx/manual/en/source/index.rst | Links the new setconfig page from the EN manual index. |
| docs/make_docs.sh | Allows building docs for a subset of languages and validates lang args. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.