1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 08:06:12 +01:00

(v2.1.1.9108) version update

This commit is contained in:
dr. M.S. (Matthijs) Berends 2024-11-21 21:58:05 +01:00
parent 0fda130a0b
commit 38bb36ca19
12 changed files with 13 additions and 10219 deletions

View File

@ -59,4 +59,6 @@ else
echo "No version number to prepend to commit message." echo "No version number to prepend to commit message."
fi fi
git add data-raw/*
exit 0 exit 0

View File

@ -113,6 +113,8 @@ echo "${currentversion}" > .git/commit_version.tmp
# Generate GPT knowledge info for our Assistant (https://chatgpt.com/g/g-M4UNLwFi5-amr-for-r-assistant) # Generate GPT knowledge info for our Assistant (https://chatgpt.com/g/g-M4UNLwFi5-amr-for-r-assistant)
bash data-raw/_generate_GPT_knowledge_input.sh "${currentversion}" bash data-raw/_generate_GPT_knowledge_input.sh "${currentversion}"
git add data-raw/* cd data-raw
bash _generate_python_wrapper.sh
git add PythonPackage/*
exit 0 exit 0

View File

@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 2.1.1.9107 Version: 2.1.1.9108
Date: 2024-11-21 Date: 2024-11-21
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,4 +1,4 @@
# AMR 2.1.1.9107 # AMR 2.1.1.9108
*(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)* *(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)*

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.1 Metadata-Version: 2.1
Name: AMR Name: AMR
Version: 2.1.1.9103 Version: 2.1.1.9107
Summary: A Python wrapper for the AMR R package Summary: A Python wrapper for the AMR R package
Home-page: https://github.com/msberends/AMR Home-page: https://github.com/msberends/AMR
Author: Dr. Matthijs Berends Author: Dr. Matthijs Berends

View File

@ -2,9 +2,6 @@ BLUE = '\033[94m'
GREEN = '\033[32m' GREEN = '\033[32m'
RESET = '\033[0m' RESET = '\033[0m'
print(f"{BLUE}AMR:{RESET} Setting up R environment and AMR datasets...", flush=True)
import os import os
from rpy2 import robjects from rpy2 import robjects
from rpy2.robjects import pandas2ri from rpy2.robjects import pandas2ri
@ -14,8 +11,6 @@ import importlib.metadata as metadata
# Get the path to the virtual environment # Get the path to the virtual environment
venv_path = os.getenv('VIRTUAL_ENV') # Path to the active virtual environment venv_path = os.getenv('VIRTUAL_ENV') # Path to the active virtual environment
if not venv_path:
raise EnvironmentError("No virtual environment detected. Please activate your Python virtual environment.")
# Define R library path within the venv # Define R library path within the venv
r_lib_path = os.path.join(venv_path, "R_libs") r_lib_path = os.path.join(venv_path, "R_libs")
@ -42,11 +37,14 @@ r_amr_version = robjects.r(f'as.character(packageVersion("AMR", lib.loc = "{r_li
# Compare R and Python package versions # Compare R and Python package versions
if python_amr_version and r_amr_version != python_amr_version: if python_amr_version and r_amr_version != python_amr_version:
try: try:
print(f"{BLUE}AMR:{RESET} Updating package version{RESET}", flush=True)
utils = importr('utils') utils = importr('utils')
utils.install_packages('AMR', repos='https://msberends.r-universe.dev', quiet=True) utils.install_packages('AMR', repos='https://msberends.r-universe.dev', quiet=True)
except Exception as e: except Exception as e:
print(f"{BLUE}AMR:{RESET} Could not update: {e}{RESET}", flush=True) print(f"{BLUE}AMR:{RESET} Could not update: {e}{RESET}", flush=True)
print(f"{BLUE}AMR:{RESET} Setting up R environment and AMR datasets...", flush=True)
# Activate the automatic conversion between R and pandas DataFrames # Activate the automatic conversion between R and pandas DataFrames
pandas2ri.activate() pandas2ri.activate()

Binary file not shown.

Binary file not shown.

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='AMR', name='AMR',
version='2.1.1.9103', version='2.1.1.9107',
packages=find_packages(), packages=find_packages(),
install_requires=[ install_requires=[
'rpy2', 'rpy2',

View File

@ -38,7 +38,7 @@ setup_file="../PythonPackage/AMR/setup.py"
functions_file="../PythonPackage/AMR/AMR/functions.py" functions_file="../PythonPackage/AMR/AMR/functions.py"
datasets_file="../PythonPackage/AMR/AMR/datasets.py" datasets_file="../PythonPackage/AMR/AMR/datasets.py"
init_file="../PythonPackage/AMR/AMR/__init__.py" init_file="../PythonPackage/AMR/AMR/__init__.py"
description_file="../DESCRIPTION"
# Write header to the datasets Python file, including the convert_to_python function # Write header to the datasets Python file, including the convert_to_python function
cat <<EOL > "$datasets_file" cat <<EOL > "$datasets_file"
@ -258,11 +258,6 @@ cp ../vignettes/AMR_for_Python.Rmd ../PythonPackage/AMR/README.md
sed -i '1,/^# Introduction$/d' ../PythonPackage/AMR/README.md sed -i '1,/^# Introduction$/d' ../PythonPackage/AMR/README.md
echo "README copied" echo "README copied"
# Path to your DESCRIPTION file
description_file="../DESCRIPTION"
# Extract the relevant fields from DESCRIPTION # Extract the relevant fields from DESCRIPTION
version=$(grep "^Version:" "$description_file" | awk '{print $2}') version=$(grep "^Version:" "$description_file" | awk '{print $2}')

File diff suppressed because one or more lines are too long