Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

linalg: export numeric constants

Abierto
#910 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
fortran
Área
backend

Línea de trabajo

The issue gives no implementation files or tests; start by reading the numeric constant definitions and the linear algebra code that uses them, then compare the existing codata API and prior work in #800 and #902. Decide how constants should be exported for both users and fypp-generated routines, and document the chosen API and generated values; the issue does not specify tests.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

idea
Motivation

As pointed out in #902, it is often tedious to read through templated numeric constants through the code.

Prior Art

#800

Additional Information
  • For the user API, maybe all needed is a consistent way to export them? One way this is present in stdlib (codata module) is to use a mold parameter and function.
  • For development (linear algebra routines will be easier to read), maybe the best approach would be to template them directly in fypp? this works well:
#! Return the unitary numeric constant for a given type and kind
#!
#! Args:
#!   type (string): an intrinsic type (complex, real, integer)
#!
#! Returns:
#!   Parameter value string
#!
#! E.g.,
#!   one('complex(dp)')  -> (1.0_dp, 0.0_dp)
#!   one('real(sp)') -> 1.0_sp
#!   one('integer') -> 1
#!
#:def one(type)
  #:assert 'integer' in type or 'real' in type or 'complex' in type
  #:if '(' in type and ')' in type
    #:set kind="_" + type.split('(')[1].split(')')[0]
  #:else
    #:set kind=""
  #:endif
  #:if 'integer' in type
    ${"1"+kind}$
  #:elif 'real' in type
    ${"1.0"+kind}$
  #:elif 'complex' in type
    ${"(1.0"+kind+",0.0"+kind+')'}$
  #:endif
#:enddef
Lenguaje dominante
Fortran
Estrellas
1.4k
Forks
233
Merge medio
4 d 11 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fortran-lang/stdlib

Todos los issues de fortran-lang/stdlib

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.