Add generic function version()

Ouverte
#28 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
58/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
r
Domaine
backend

Piste de recherche

Start by reading how BiocGenerics defines and exports existing S4 generic functions, then check the package's tests and documentation conventions. Add a version(object) generic following those conventions; done means it is exported and its generic signature is covered consistently with other generics. The issue does not name specific files or tests, so locate those entry points in the repository first.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Requested by the spatialdataR folks.

After quickly going around the Bioconductor ecosystem, I found that several packages define the version() function, either as a regular function, or as an S4 generic function with methods:

BiocManager:

  • regular function with no argument

DaparToolshed:

  • generic with 1 method
  • generic's arguments: version(object, ...)
  • note that the method does not use the ellipsis

GenomicSuperSignature:

  • generic with 1 method
  • generic's arguments: version(x)

NanoStringNCTools:

  • generic with 1 method
  • generic's arguments: version(object, ...)
  • note that the method does not use the ellipsis

RedeR:

  • generic with 1 method
  • generic's arguments: version(obj)

Rigraphlib:

  • regular function with 1 argument
  • arguments: version(expected = FALSE)

msa:

  • generic with 1 method
  • generic's arguments: version(object)

I propose to use version(object) for the version() generic that we add to BiocGenerics. Better not to have the ellipsis in the argument list if it's not used. Problem with having the ellipsis in the generic and then define methods that ignore the ellipsis is that extra arguments mistakenly passed thru these methods are silently ignored instead of triggering an error.

So we can always add the ellipsis later when it's actually needed. Note that it's easy to do and doesn't break the existing methods.

Finally, as @Artur-man pointed out, conflicts with BiocManager::version() will be avoided by using the BiocManager:: prefix. Same thing with Rigraphlib::version().

Langage dominant
R
Étoiles
13
Forks
8
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Bioconductor/BiocGenerics

Toutes les issues de Bioconductor/BiocGenerics

Issues similaires

Plus d'issues R

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.