1
0
mirror of https://github.com/msberends/AMR.git synced 2025-04-22 03:23:54 +02:00

(v2.1.1.9244) automated GPT training data

This commit is contained in:
dr. M.S. (Matthijs) Berends 2025-04-19 15:57:12 +02:00
parent ca00ed468e
commit 492fe6872f
No known key found for this signature in database
8 changed files with 74 additions and 10466 deletions

View File

@ -111,8 +111,6 @@ echo ""
# Save the version number for use in the commit-msg hook
echo "${currentversion}" > .git/commit_version.tmp
# Generate GPT knowledge info for our Assistant (https://chat.amr-for-r.org)
bash data-raw/_generate_GPT_knowledge_input.sh "${currentversion}"
git add data-raw/*
git add -u

View File

@ -93,5 +93,4 @@ jobs:
git rm -rf . || true
git add .
git commit -m "Python wrapper update"
# git push origin python-wrapper --force
git push https://$PYPI_PAT@github.com/msberends/AMR.git python-wrapper --force

View File

@ -0,0 +1,67 @@
# ==================================================================== #
# TITLE: #
# AMR: An R Package for Working with Antimicrobial Resistance Data #
# #
# SOURCE CODE: #
# https://github.com/msberends/AMR #
# #
# PLEASE CITE THIS SOFTWARE AS: #
# Berends MS, Luz CF, Friedrich AW, et al. (2022). #
# AMR: An R Package for Working with Antimicrobial Resistance Data. #
# Journal of Statistical Software, 104(3), 1-31. #
# https://doi.org/10.18637/jss.v104.i03 #
# #
# Developed at the University of Groningen and the University Medical #
# Center Groningen in The Netherlands, in collaboration with many #
# colleagues from around the world, see our website. #
# #
# This R package is free software; you can freely use and distribute #
# it for both personal and commercial purposes under the terms of the #
# GNU General Public License version 2.0 (GNU GPL-2), as published by #
# the Free Software Foundation. #
# We created this package for both routine data analysis and academic #
# research and it was publicly released in the hope that it will be #
# useful, but it comes WITHOUT ANY WARRANTY OR LIABILITY. #
# #
# Visit our website for the full manual and a complete tutorial about #
# how to conduct AMR data analysis: https://amr-for-r.org #
# ==================================================================== #
on:
push:
# only on main
branches: "main"
name: Publish GPT Training Data to GitHub
jobs:
update-pypi:
runs-on: ubuntu-latest
env:
PYPI_PAT: ${{ secrets.PYPI_PAT }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build the training data
run: |
cd data-raw/
bash _generate_GPT_knowledge_input.sh
- name: Git push to amr-for-r-assistant repo
run: |
mkdir ~/other
# to also mv hidden files:
shopt -s dotglob
mv ./* ~/other/
git clone https://github.com/msberends/amr-for-r-assistant
cd amr-for-r-assistant
mv ~/other/data-raw/latest_training_data.txt ./
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add latest_training_data.txt
git commit -m "GPT training data update"
git push https://$PYPI_PAT@github.com/msberends/amr-for-r-assistant.git main --force

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 2.1.1.9243
Date: 2025-04-18
Version: 2.1.1.9244
Date: 2025-04-19
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by

View File

@ -1,4 +1,4 @@
# AMR 2.1.1.9243
# AMR 2.1.1.9244
*(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://amr-for-r.org/#get-this-package).)*

View File

@ -6,11 +6,11 @@ if [ "$(basename "$PWD")" != "AMR" ]; then
exit 1
fi
rm -rf data-raw/gpt_training_text_v*
rm data-raw/latest_training_data.txt
# Define the output file, located in ./data-raw
version="$1"
output_file="data-raw/gpt_training_text_v${version}.txt"
output_file="data-raw/latest_training_data.txt"
# Clear the output file if it exists
echo "This knowledge base contains all context you must know about the AMR package for R. You are a GPT trained to be an assistant for the AMR package in R. You are an incredible R specialist, especially trained in this package and in the tidyverse." > "$output_file"

File diff suppressed because one or more lines are too long

View File

@ -75,7 +75,7 @@ test_that("test-sir.R", {
)
expect_error(as.sir.mic(as.mic(16)))
expect_error(as.sir.disk(as.disk(16)))
expect_error(get_guideline("this one does not exist"))
expect_error(AMR:::get_guideline("this one does not exist"))
if (AMR:::pkg_is_available("dplyr", min_version = "1.0.0", also_load = TRUE)) {
# 40 sir columns
@ -128,7 +128,7 @@ test_that("test-sir.R", {
# allow for guideline length > 1
expect_equal(
get_guideline(c("CLSI", "CLSI", "CLSI2023", "EUCAST", "EUCAST2020"), AMR::clinical_breakpoints),
AMR:::get_guideline(c("CLSI", "CLSI", "CLSI2023", "EUCAST", "EUCAST2020"), AMR::clinical_breakpoints),
c("CLSI 2024", "CLSI 2024", "CLSI 2023", "EUCAST 2024", "EUCAST 2020")
)