1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-12 05:42:18 +02:00

(v2.1.1.9223) allow + ab

This commit is contained in:
2025-03-20 22:56:32 +01:00
parent d147d6602d
commit bb110646db
10 changed files with 43 additions and 30 deletions

View File

@ -73,26 +73,23 @@ if not isinstalled('AMR', lib_loc=r_lib_path):
print(f"AMR: Installing latest AMR R package to {r_lib_path}...", flush=True)
utils.install_packages('AMR', repos='https://msberends.r-universe.dev', quiet=True)
# Retrieve Python AMR version
try:
python_amr_version = metadata.version('AMR')
except metadata.PackageNotFoundError:
python_amr_version = ''
# Retrieve R AMR version
r_amr_version = robjects.r(f'as.character(packageVersion("AMR", lib.loc = "{r_lib_path}"))')
r_amr_version = str(r_amr_version[0])
print(python_amr_version)
print(r_amr_version)
# Compare R and Python package versions
if r_amr_version != python_amr_version:
try:
print(f"AMR: Updating AMR package in {r_lib_path}...", flush=True)
utils.install_packages('AMR', repos='https://msberends.r-universe.dev', quiet=True)
except Exception as e:
print(f"AMR: Could not update: {e}", flush=True)
# # Retrieve Python AMR version
# try:
# python_amr_version = metadata.version('AMR')
# except metadata.PackageNotFoundError:
# python_amr_version = ''
#
# # Retrieve R AMR version
# r_amr_version = robjects.r(f'as.character(packageVersion("AMR", lib.loc = "{r_lib_path}"))')
# r_amr_version = str(r_amr_version[0])
#
# # Compare R and Python package versions
# if r_amr_version != python_amr_version:
# try:
# print(f"AMR: Updating AMR package in {r_lib_path}...", flush=True)
# utils.install_packages('AMR', repos='https://msberends.r-universe.dev', quiet=True)
# except Exception as e:
# print(f"AMR: Could not update: {e}", flush=True)
print(f"AMR: Setting up R environment and AMR datasets...", flush=True)