Skip to content

Breaking change: Disallow CmdStanModel without executable #695

Closed

Description

@WardBrian

Summary:

As discussed in #689.

The current behavior when exe_file=None, compile=False yields a broken object - essentially all methods other than compile() cannot be called until after compile() is called.

I think it should be factored such that:

cmdstanpy.compile(stan_file, force=False, stanc_args={}, cmdstan_args={}) -> str
is a function outside of any class which invokes make as requested.

And the constructor looks like
CmdStanMLE(stan_file=None, exe_file=None, force_compile=False, stanc_args={}, cmdstan_args={})

This raises an error if:

  • stan_file and exe_file are both None, or
  • force_compile is True but stanc_file was None

Otherwise, it will always be the case that when the constructor is finished, we have an executable ready for use (either because the user supplied one, or because we compiled it)

This would be a 2.0 change

Activity

  1. added this to the 2.0 milestone on Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions