Skip to content

Update easybgm to allow for the most recent bgms version and small bug fixes. - #133

Merged
KarolineHuth merged 14 commits into
KarolineHuth:mainfrom
Bayesian-Graphical-Modelling-Lab:pr-4
Jul 9, 2026
Merged

KarolineHuth merged 14 commits into
KarolineHuth:mainfrom
Bayesian-Graphical-Modelling-Lab:pr-4

Conversation

@KarolineHuth

Copy link
Copy Markdown
Owner

[] updates easybgm to allow for the most recent bgms version 0.2.0
[] for the most recent bgms, changes default package settings to bgms for all types of data
[] adapts compatibility for prior specification in bgms version 0.2.0

Nikola and others added 14 commits March 25, 2026 17:25
…ects

The class(fit) <- 'bgms' and class(fit) <- c('bgmCompare') lines in
bgm_extract.package_bgms() and bgm_extract.package_bgms_compare()
overwrite the S7 class vector c('bgms', 'S7_object') with a plain
string. This destroys the S7 metadata and makes all property access
fail when bgms >= 0.2.0 returns S7 objects.

The lines are also unnecessary for S3: the object already carries the
correct class from bgm() / bgmCompare(), or from fit$packagefit which
preserves whatever class bgms assigned.
…e-class-reassignment

fix: remove redundant class(fit) reassignment that breaks S7 bgms obj…
Merge branch 'main' into update_easybgm

# Conflicts:
#	R/easybgm.R
#	R/easybgm_compare.R
#	R/functions.bgms.R
#	R/functions.bgmscompare.R
#	R/plottingfunctions.bgmCompare.R
#	R/summary.easybgm.R
#	man/easybgm.Rd
#	man/easybgm_compare.Rd
#	tests/testthat/Rplots.pdf
…w true S7 objects, includes prior classes).
Merge branch 'main' into update_easybgm

# Conflicts:
#	tests/testthat/Rplots.pdf
#	tests/testthat/test-easybgm.R
bgms 0.2.0.0 returns fit objects as S7 (class c("bgms", "S7_object")).
Two easybgm extraction paths broke against it:

- bgm_extract.package_bgms overwrote the fit class with plain "bgms",
  stripping "S7_object" and breaking the $.bgms / [[.bgms accessors
  (they dispatch on inherits(x, "S7_object") then use S7::prop()).
  Guard the assignment with !inherits(fit, "bgms"); still backward
  compatible with pre-S7 (list-based) bgms.

- bgm_extract.package_bgms_compare read the Bernoulli difference prior
  via a broken guard and a non-existent args field, silently falling
  back to 0.5. Read it directly from args$inclusion_probability instead.
@KarolineHuth
KarolineHuth merged commit 87a8dea into KarolineHuth:main Jul 9, 2026
0 of 3 checks passed
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.

3 participants