Skip to content

Release 5.4.0: blocks on the new BiobbObject - #10

Merged
RubenChM merged 27 commits into
masterfrom
release-5.4.0
Nov 27, 2026
Merged

RubenChM merged 27 commits into
masterfrom
release-5.4.0

Conversation

@RubenChM

Copy link
Copy Markdown
Contributor

The changes of this package for the 5.4.0 release, built on the unreleased biobb_common master.

The main change is that the work every block used to repeat now lives in BiobbObject, so the blocks keep only what is specific to their tool:

  • Blocks implement run(). BiobbObject.launch() checks the inputs and properties, handles the restart, copies the files to the sandbox and the outputs back, and cleans up.
  • Constructors call super().__init__(**locals()), and BiobbObject takes the properties and their defaults from the docstring. Defaults that differed between the docstring and the code were made equal.
  • Each module ends with tool_name = launcher(ToolName), and the console scripts point to ToolName.main.
  • Bug fixes, and the accepted formats that were only in the old path checks are now in the docstrings (see the commits).

What this means for users is in the biobb_common change log.

CI: the PR tests and the container tests (Docker and Singularity) run with biobb_common master.

Not ready to merge until biobb_common 5.4.0 is released and this package's version and its biobb_common pin are bumped.

…tart and the staging

Needs biobb_common 5.4.0. The launchlogger decorator, the checks of the constructors and the calls to check_restart() and stage_files() are removed from the blocks. What a block does before staging its files (ie: the stdin file) is in prepare(). The path checks of check_data_params() and their helpers are removed: check_arguments() of BiobbObject checks the paths.
… return code

Needs biobb_common 5.4.0. BiobbObject.launch() now copies the outputs to the host, removes the temporary files, checks the outputs and returns self.return_code after run(), also after an early return: the blocks no longer call copy_to_host(), remove_tmp_files() nor the final check_arguments(), and run() returns nothing.

The work on the outputs after the copy is in process_outputs(): pmxgentop.
…py to the host

Needs biobb_common 5.4.0 (BiobbObject.sandbox_file(), no process_outputs()). The blocks fix or build their outputs at the end of run() on the paths given by self.sandbox_file(), so BiobbObject.launch() copies the result to the host and copy_to_host() no longer logs them as missing in the sandbox.

pmxgentop (topology zip).
…), command paths with staged_path()

Needs biobb_common 5.4.0 (BiobbObject.staged_path(); create_tmp_file() and create_tmp_dir() also before the staging and without sandbox). No temporary folder is created in the cwd any more, and the files of the sandbox that the command reads get their path with staged_path() instead of a container branch in each block.

pmxanalyse (the xvg folders are created in the sandbox instead of copied into it), pmxmutate, pmxcreate_top and pmxmerge_ff.
They read and write the io_dict paths, so staging their inputs was useless and copy_to_host(), which BiobbObject.launch() now calls for every block, logged their outputs as missing in the sandbox.

pmxcreate_top and pmxmerge_ff (they use the io_dict paths instead of the staged ones).
…he block

Needs biobb_common 5.4.0 (the log argument of BiobbObject.create_tmp_dir()). pmxcreate_top and pmxmerge_ff.
…the properties

Needs biobb_common 5.4.0 (BiobbObject.__init__ builds the io_dict from the documented arguments and sets one attribute per documented property with the default of the docstring). The constructors keep their signature, call super().__init__(**locals()) first and keep only what is specific to the block: no properties = properties or {}, locals_var_dict, io_dict literal, properties.get() of documented properties or self.properties = properties. Migrated with python -m biobb_common.tools.migrate_launch and hand edits.

pmxatom_mapping noH2H and nochirality documented False (None, not passed, behaves like False), distance None; pmxligand_hybrid scDUMm, scDUMa, scDUMd and distance None; pmxgentop and pmxmutate gmx_lib None (computed). Commented property reads removed. pmxanalyse and pmxgentop take their zip inputs out of the io_dict after super().__init__(). JSON schemas regenerated.
Needs biobb_common 5.4.0 (launcher() and BiobbObject.main(); get_main() is removed). Each block module ends with tool_name = launcher(ToolName), the launcher function with the signature and docstring of the class, and if __name__ == "__main__": ToolName.main(). The def tool_name(...) launchers, tool_name.__doc__ = ToolName.__doc__ and main = ToolName.get_main(...) are removed and the console scripts of setup.py are <module>:ToolName.main. The command line exits with the exit code of the block and its -h description is the title and description lines of the docstring. Constructors without annotations get the ones of the launcher. Migrated with python -m biobb_common.tools.migrate_launch.
gbayarri
gbayarri previously approved these changes Nov 26, 2026
… the blocks

The command runs in the sandbox (in containers, in container_volume_path) and stage_io_dict gives the
staged files by name (biobb_common 5.4.0). The Python code of the blocks uses sandbox_file().
container_working_dir removed from the docstrings, test configs, JSON schemas and command_line.md.
export GMXLIB first in containers; create_top zips without os.chdir; gentop unzips the topology in
the sandbox; mutate passes the mutations file with staged_path().
…re()

The same is_file()/shutil.which() check was in run() of pmxanalyse, pmxatom_mapping,
pmxgentop, pmxligand_hybrid and pmxmutate. In prepare() it fails before the sandbox.
pmx atomMapping and ligandHybrid never read GMXLIB (only mutate and gentop look for
force fields), and the property was not documented.
On the host, gmx_lib becomes an absolute path (the command runs in the sandbox, a
relative path is relative to the working directory), and without gmx_lib GMXLIB is the
mutff folder of the pmx package of the Python environment, also outside conda.
…est folder of its name; modules in subfolders run their tool's tests
@RubenChM
RubenChM merged commit 10a19ce into master Nov 27, 2026
4 checks passed
@RubenChM
RubenChM deleted the release-5.4.0 branch November 30, 2026 14:02
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.

2 participants