Coder Social home page Coder Social logo

pharmaverse / admiraltemplate Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 3.0 8.66 MB

Recommended Structure for admiral R package extensions

Home Page: https://pharmaverse.github.io/admiraltemplate/

License: Apache License 2.0

R 58.08% Shell 10.61% Rez 31.31%

admiraltemplate's Introduction

pharmaverse website

pharmaverse.org

This website is maintained and governed by our website community. Further details of this are available here. The community lead is considered the product owner for the website and has final say on any decisions related to the website.

For any questions or enhancements for the site, please make issues at this repo.

Hosted sites:

This website is available at 2 locations:

Development / git flow

When you push to develop OR make a pull request onto develop a github action will run which will render the site, and deploy it to the test server. But the test server is different depending on which route you took.

The code on develop is hosted to: http://openpharma.s3-website.us-east-2.amazonaws.com/develop/

The intended workflows expects that develop is the UAT branch where you check things pre-prod. While the 'build from PR` allows you to work on something very experimental and check results, before pushing it do develop.

This git flow is predicated on it being unlikely to have more than one person actively working on the site at any one time.

You cannot work directly on main branch. The only way to push in is via a PR. And it will be denied if you have not come through develop. Any PR requires approval from one other Technology and Templates WG member.

Data flows

'Scraped' data

Passive data is collected via openpharma.github.io, a sister org that is completely un-opinionated and has
a wider remit spanning discovery to access. This site contains no curated data beyond names - and is instead focused on collecting and sharing data on open source health and related metadata (e.g. CRAN status and riskmetric scores).
Information on the data collected is here: https://openpharma.github.io/#data.

Data is stored in a pharmaverse AWS account.

Package info

Curated package info is stored in the folder data/. pharmaverse packages are in the folder data/packages. Non-pharma packages that get a special mention are in data/nonpharma. Each package is a unique .yaml file.

The general structure is:

name: admiral
repo: pharmaverse/admiral
repo_source: github.com
docs: https://pharmaverse.github.io/admiral/cran-release/
hex: https://github.com/insightsengineering/hex-stickers/raw/main/PNG/admiral.png
task: ADaM
details: (ADaM In R Asset Library) - Modular framework to generate ADaM via R functions relying on community contributions
splash: include # this controls what is shown on the main page. Plan is to deprecate and put all hex's up

It should be self explanatory. Please use the categories in the site for task:.

People

Info on people is in data/people. The yaml should be something like below, with the filename being the github handle.

name: James Black
pharmaverse_roles: tech
company: Roche
company_logo: roche.png
# Following is more a nice to have for profile pages [and optional]
linkedin: https://www.linkedin.com/in/epijim/
site: https://epijim.uk
title: People and Product Family Leader for Insights Engineering, Scientific Computing Environment Product Owner
bio: James is currently leading our pan-study codebase for insights

General content of the site

Site content is in content. It's normal markdown files. See markdown-guide.md.

Calling package info in the site

To call a package, we have two shortcuts. pharmaverse means it's 'pharmaverse' - e.g. in the folder data/packages. otherpackages is for non-pharmaverse packages, in data/nonpharma.

{{< pharmaverse pkg="rtables" >}}

{{< otherpackages pkg="gt" >}}

Council meeting minutes

From 2023 onwards, our monthly council meeting minutes will be published in static/council meeting minutes. Other static files such as images are stored in static also.

admiraltemplate's People

Contributors

actions-user avatar bms63 avatar bundfussr avatar cicdguy avatar dgrassellyb avatar galachad avatar manciniedoardo avatar pharmaverse-bot avatar rossfarrugia avatar zdz2101 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

admiraltemplate's Issues

Feature Request: Use package versions from `renv.lock` in workflows

Feature Idea

I would propose that the workflows use the package versions from renv.lock instead of installing the latest one. Otherwise, it is hard to reproduce the findings of the workflow and it could happen that a workflow fails because a new version of a package like styler was released.

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

Create linkable ToC in Readme

Readme should have Table of Contents with links to necessary sections

  • Goal of this tempalte
  • How to use this Template
  • What to check once you set up the Tempalte
  • What is in the Template
  • Package Extension Guidance

General Issue: Remove non-ASCII characters in the package

Background Information

Non-ASCII characters cause NOTES to appear when running pre-release checks. We should remove any from the package to avoid any issues. This is especially important in admiraltemplate, which is used as the basis of so many packages!

Definition of Done

  • Run the following in the searchbar on github:
    repo:pharmaverse/admiraltemplate /[^\x00-\x7F]+/
  • Remove anything flagged.

Feature Request: Simplify creating and maintaining `renv.lock`

Feature Idea

Manually updating the renv.lock is tedious because it is not clear if an entry is required by admiral core or the extension package.

I would propose

  • to add a package.lock file which contains only those packages which are required by the extension package but not by admiral core (or other admiral extension packages) and
  • to implement a function in admiral or admiraldev which collates the packages from package.lock and the renv.lock files of all admiral packages the extension package is depending on and writes the renv.lock file.

Open question: Should the renv.lock contain other admiral packages?

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

Add snaphot testing exmaple

Way cool Ross! Just some thoughts on a few things. Iโ€™m not super passionate about any of them.

Other ideas that maybe others can work on:

  • snapshot tests example with two examples one works and one errors (this really makes writing tests so much less painful)
  • Remotes in DESCRIPTION

these overkill? I can make into issues if not

Originally posted by @bms63 in #79 (review)

Feature Request: Use `cookiecutter` for faster extension boostrapping

Feature Idea

Given how many manual steps are involved in creating a new admiral extension, consider minimizing the number of manual steps and autonating extension boostrapping by restructuring this template with the
cookiecutter framework.

Relevant Input

Someone runs cookiecutter gh:pharmaverse/admiraltemplate and follows the prompts to initialize a new extension, instead of reading a document on the steps involved in initializing a new extension.

Relevant Output

The extension package is fully bootstrapped via cookiecutter.

Reproducible Example/Pseudo Code

Eg:

# Install cookiecutter
pip3 install cookiecutter

# Try it out on an example repo
cookiecutter gh:audreyr/cookiecutter-pypackage

Function to rename template files to package name and other goodies

Background

A person who clones the admiraltemplate repo for an extension package has a lot of housecleaning and setup to make it their own. A function should be created that does all the chores for them. For example, make_extension() would update the name of the package in the DESCRIPTION file and other files where either admiraltemplate or admiralext exixts.

Context

This crashes our checks - maybe we could have a startup message that refers to a function that when calls updates everything for the extension pkg? Maybe fun issue for someone to work on from community?

Originally posted by @bms63 in #79 (comment)

Definition of Done

  • Create function that cleans house for an extension package
    • DESCRIPTION files
    • Cleans testthat folder
    • Could place skeleton in readme similar to other admiral packages
    • Renames admiraltemplate.Rproj
    • Renames .Rbuildignore
    • Renames admiraltemplate-package.R
    • Others where needed (creativity is encouraged)
    • Recommendation on resources for creating hex image
      -[ ] Startup Message recommending the function and then on how to remove the Startup message

@pharmaverse/admiral @pharmaverse/admiral_comm Low priority, but a fun one to work on if anyone wants to make a simple "updater" function. It will not get a lot of use, but will make life easier for future extensions. :)

General Issue: Review content and update as needed

Background Information

We developed this template repo a year and some of the content is outdated.

A full review is needed and updates/discussion can either be made with the issue tagged or additional issues can be created.

Definition of Done

  • Thorough review of Files
  • Update relevant files

Set up other Package folders to mimic admiral

  • data

  • inst

  • man

  • pkgdown/favicon

  • renv

  • vignettes

  • The first three can probably have the readme dummy file

  • Not sure what goes in the pkgodwn site - maybe the pharmaverse badge?

  • I think a dummy vignette shoudl go here so website is built and maybe an article and change log?

@bms63 , we need the `docs` folder and the `pkgdown.yml` file to enable linking across different admiral packages. For example, if we have `admiral::derive_vars_merged()` in the admiralonco documentation, it will link to the admiral documentation.

@bms63 , we need the docs folder and the pkgdown.yml file to enable linking across different admiral packages. For example, if we have admiral::derive_vars_merged() in the admiralonco documentation, it will link to the admiral documentation.

So please do not remove it.

Originally posted by @bundfussr in pharmaverse/admiral#1298 (comment)

Update README - Quick Start Guide for Template

Please select a category the issue is focused on?

No response

Let us know where something needs a refresh or put your idea here!

Can we add .Rbuildignore/.gitignore/.lycheeignore/_pkgdown.yml to the following part of the README?

image

Documentation: Package extension guidance should link to admiraldev site

Please select a category the issue is focused on?

Other

Let us know where something needs a refresh or put your idea here!

@bms63 @manciniedoardo should https://pharmaverse.github.io/admiraltemplate/cran-release/index.html#package-extension-guidance be replaced with a link to https://pharmaverse.github.io/admiraldev/articles/package_extensions.html now? i trust the admiraldev site version is the one we should refer to for admiralpeds

Documentation: Add README.md to workflows folder

Please select a category the issue is focused on?

Other

Let us know where something needs a refresh or put your idea here!

README.md should be added to the workflows folder. For each workflow in the workflows folder it should provide:

  • A short description of the workflow.
  • Prerequisites for using the workflow.

Feature Request: Centralize Package Dependencies for Workflows

Feature Idea

If possible, I would like to centralize the install dependencies step in the workflows which call functions from the extension package.
Usually it contains code like

          ref <- if (Sys.getenv("GITHUB_REF_NAME") == "main") "main" else "devel"
          remotes::install_github(
            "pharmaverse/admiral.test",
            ref = ref,
            dependencies = FALSE,
            upgrade = "never"
          )

for all admiral packages the extension package is depending on.

Maybe we could also have a simple file where the admiral dependencies are listed (and function which reads in the file in the install dependencies step). Something like

admiral.test: main
admiral: devel
admiralonco: devel

The value after the package indicates which version of the package should be used:

  • main: Always use the main version of the package
  • devel: Use the devel version of the package for PRs into devel and the main version for PRs into main.

Relevant Input

No response

Relevant Output

No response

Reproducible Example/Pseudo Code

No response

Bug: New template "About" link breaks because of the way we set up CI/CD

What happened?

image

Session Information

No response

Reproducible Example

image

I suspect if we switch these from "cran-release" to "main" it should solve it, but because we are not sending this off to CRAN this breaks. Should we still modify for a package's first website they need to point to not cran-release because it will not have been released to CRAN yet?

Bring in line with latest admiral release new conventions

After Sept admiral release, come back to admiraltemplate and bring in line with recent admiral strategy changes, such as the move of utilities to admiraldev, the move of the workflows to admiralci, the reference page re-structure: pharmaverse/admiral#1105, new roxygen header conventions: pharmaverse/admiraldev#72. Please anyone add any others relevant that i may have missed!

FYI @bms63 @thomas-neitmann @cicdguy (and @hiren8484 you should watch this issue for admiralophtha as these updates will be relevant there too later - they were all detailed at the last admiral community meeting - catch the recording on Slack if you missed it).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.