Skip to content

Commit 44e6725

Browse files
committed
Adding the new module
1 parent dfb5237 commit 44e6725

File tree

26 files changed

+462
-200
lines changed

26 files changed

+462
-200
lines changed

.github/workflows/CI.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ jobs:
5757
channels:
5858
- uibcdf
5959
- conda-forge
60-
- defaults
6160
channel_priority: strict
6261
6362
create-args: >-

NotePad.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,73 @@ Where are openmm.unit, unyt or Pint published?
2626
## Ideas
2727

2828
Maybe, if we find different examples of scientific libraries using different unit libraries, we could justify that in a same workflow changing forms is needed.
29+
30+
# ChatGPT summary
31+
Aquí tienes el resumen actualizado, eliminando la referencia al factor de impacto de **JOSS** y aclarando su indexación:
32+
33+
---
34+
35+
## **📌 Discusión sobre la publicación del artículo de PyUnitWizard**
36+
37+
### **1️⃣ Objetivo del artículo**
38+
- Presentar **PyUnitWizard** como una herramienta para manejar unidades en cálculos científicos con Python.
39+
- Explicar cómo resuelve problemas de interoperabilidad entre bibliotecas (`numpy`, `matplotlib`, `pint`, etc.).
40+
- Incluir ejemplos de uso, impacto en la comunidad científica y comparaciones con otras herramientas similares.
41+
42+
---
43+
44+
### **2️⃣ Revistas consideradas**
45+
Evaluamos varias opciones con **factor de impacto (FI) e indexadas** en **Scopus y Web of Science**.
46+
47+
#### **🔹 Opción más viable**
48+
- **[SoftwareX (Elsevier)](https://www.sciencedirect.com/journal/softwarex)**
49+
- **FI ≈ 5.0**, indexada en **Scopus y Web of Science**.
50+
- Publica artículos sobre **software científico de código abierto**.
51+
- **Alta probabilidad de aceptación** si el artículo presenta bien el software.
52+
53+
#### **🔹 Alternativa rápida sin FI pero bien reconocida en la comunidad**
54+
- **[Journal of Open Source Software (JOSS)](https://joss.theoj.org/)**
55+
- **No tiene factor de impacto (FI) oficial en JCR, pero está indexado en DBLP y DOAJ**.
56+
- Publicación **rápida y accesible**, enfocada en software de código abierto.
57+
- **Buena opción si se prioriza visibilidad en la comunidad open-source y menor tiempo de revisión**.
58+
59+
#### **🔹 Otras opciones viables**
60+
- **[Computer Physics Communications (Elsevier)](https://www.sciencedirect.com/journal/computer-physics-communications)**
61+
- **FI ≈ 3.5**, indexada en **Scopus y Web of Science (Q1/Q2)**.
62+
- Buena opción si se enfoca en aplicaciones en física computacional.
63+
- **[Journal of Chemical Information and Modeling (ACS)](https://pubs.acs.org/journal/jcisd8)**
64+
- **FI ≈ 4.0**, ideal si hay aplicaciones en química computacional.
65+
- **[Journal of Open Research Software (JORS)](https://openresearchsoftware.metajnl.com/)**
66+
- **Indexada en Scopus**, buena opción si se prioriza rapidez en la publicación.
67+
68+
#### **🔹 Opciones menos recomendadas (por revisiones exigentes)**
69+
- *Nature Computational Science*: Muy difícil de publicar sin validaciones extensivas.
70+
- *Journal of Computational Science*: Buena opción, pero requiere fuerte justificación matemática.
71+
72+
---
73+
74+
### **3️⃣ Alternativa de presentar en una conferencia antes de la publicación**
75+
- Presentar **PyUnitWizard** en una conferencia para obtener feedback antes de enviar a una revista.
76+
- **Conferencias sugeridas**:
77+
- [SciPy Conference](https://www.scipy2024.scipy.org/) → Enfocada en Python en ciencia.
78+
- [EuroSciPy](https://www.euroscipy.org/) → Versión europea, buena para networking.
79+
- [IEEE e-Science Conference](https://www.escience-conference.org/) → Más formal, revisada por pares.
80+
81+
---
82+
83+
### **4️⃣ Estrategia recomendada**
84+
1. **Escribir el artículo con enfoque en software científico y su impacto**.
85+
2. **Enviar primero a SoftwareX (Elsevier)** por su balance entre **factor de impacto y probabilidad de aceptación**.
86+
3. **Si se prioriza rapidez y visibilidad en la comunidad open-source, considerar JOSS (aunque sin FI en JCR)**.
87+
4. **Explorar la opción de presentar en SciPy o EuroSciPy antes de la publicación**.
88+
5. **Si el artículo es rechazado en SoftwareX, considerar JORS como alternativa rápida**.
89+
90+
---
91+
92+
📢 **Conclusión**: **SoftwareX sigue siendo la mejor opción** para obtener una publicación con impacto y visibilidad.
93+
🔹 **JOSS es una alternativa excelente si se prioriza rapidez y reconocimiento en la comunidad open-source, aunque sin FI oficial en JCR.**
94+
🚀 **¿Siguiente paso?** Preparar la estructura del artículo según los requisitos de SoftwareX o JOSS.
95+
96+
---
97+
98+
🔹 Si necesitas más detalles o ayuda para estructurar el artículo, dime y podemos trabajarlo juntos. 📄✨

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
# PyUnitWizard
22

3-
[![GitHub Actions Build Status](https://github.com/uibcdf/PyUnitWizard/workflows/CI/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions?query=workflow%3ACI)
4-
[![codecov](https://codecov.io/gh/uibcdf/PyUnitWizard/branch/master/graph/badge.svg)](https://codecov.io/gh/uibcdf/PyUnitWizard/branch/master)
53
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
64
[![](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12-blue.svg)](https://www.python.org/downloads/)
5+
[![Documentation](https://github.com/uibcdf/PyUnitWizard/actions/workflows/sphinx_docs_to_gh_pages.yaml/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions/workflows/sphinx_docs_to_gh_pages.yaml)
6+
[![CI](https://github.com/uibcdf/PyUnitWizard/actions/workflows/CI.yaml/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions/workflows/CI.yaml)
7+
[![codecov](https://codecov.io/github/uibcdf/PyUnitWizard/graph/badge.svg?token=9ZMA4YZLOR)](https://codecov.io/github/uibcdf/PyUnitWizard)
78
[![Install with conda](https://img.shields.io/badge/Install%20with-conda-brightgreen.svg)](https://conda.anaconda.org/uibcdf/pyunitwizard)
9+
[![Installation on ubuntu-latest](https://github.com/uibcdf/PyUnitWizard/actions/workflows/install_ubuntu_latest.yaml/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions/workflows/install_ubuntu_latest.yaml)
10+
[![Installation on macos-latest](https://github.com/uibcdf/PyUnitWizard/actions/workflows/install_macos_latest.yaml/badge.svg)](https://github.com/uibcdf/PyUnitWizard/actions/workflows/install_macos_latest.yaml)
811

9-
There are several Python libraries to work with physical quantities in the market, such as pint, unyt or openmm.unit. Imagine that your project or workflow requires the interaction with more than one of these tools, or that you are not sure if you will work with a different quantities library in the future. Wouldn't having a unique API to work with different forms of physical quantities be a relief? PyUnitWizard just does that. It is the wizard you need in your code to change the form of your quantities with no effort.
12+
13+
There are several Python libraries to work with physical quantities in the
14+
market, such as pint, unyt or openmm.unit. Imagine that your project or
15+
workflow requires the interaction with more than one of these tools, or that
16+
you are not sure if you will work with a different quantities library in the
17+
future. Wouldn't having a unique API to work with different forms of physical
18+
quantities be a relief? PyUnitWizard just does that. It is the wizard you need
19+
in your code to change the form of your quantities with no effort.
1020

1121
## Example
1222

devtools/requirements.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
setup:
22
channels: &setup_channels
33
- conda-forge
4-
- default
54
dependencies: &setup_dependencies
65
- python
76
- pip

pyunitwizard/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
from ._version import __version__
88

99
# Add imports here
10-
from .constants import constants as _constants
11-
from .constants import constants_synonyms as _constants_synonyms
1210
from .main import unit, quantity, get_form, is_quantity, is_unit
1311
from .main import get_value, get_unit, get_value_and_unit, change_value
1412
from .main import convert
1513
from .main import get_standard_units, standardize, get_dimensionality
16-
from .main import concatenate, stack, hstack, vstack
1714
from .main import are_compatible, are_equal, are_close, check
18-
from .main import get_constant, show_constants
1915
from . import configure
2016
from . import kernel as _kernel
17+
from . import constants
18+
from . import utils
2119

2220
_kernel.initialize()
2321

pyunitwizard/configure/configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pyunitwizard._private.forms import digest_form
44
from pyunitwizard._private.lists_and_tuples import is_list_or_tuple
55
from pyunitwizard.main import convert, get_dimensionality
6-
from pyunitwizard import _constants, _constants_synonyms
6+
from pyunitwizard.constants import _constants, _constants_synonyms
77
import numpy as np
88
from importlib.util import find_spec
99
from typing import List, Dict, Union

pyunitwizard/constants.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

pyunitwizard/constants/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .constants import get_constant, show_constants
2+
from .constants import _constants, _constants_synonyms

pyunitwizard/constants/constants.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from .._private.quantity_or_unit import ArrayLike, QuantityOrUnit, QuantityLike, UnitLike
2+
from typing import Any, Dict, Optional, Union, Tuple
3+
4+
_constants = {
5+
'Avogadro': [6.02214076e+23, '1/mole'],
6+
'Universal gas': [8.13446261815324, 'J/(kelvin*mole)'], # Avogadro * Boltzmann
7+
'Boltzmann': [1.380649e-23, 'J/kelvin'],
8+
}
9+
10+
_constants_synonyms = {
11+
'NA': 'Avogadro',
12+
'R': 'Universal gas',
13+
'Molar gas': 'Universal gas',
14+
'KB': 'Boltzmann',
15+
}
16+
17+
18+
def get_constant(constant_name: str,
19+
to_unit: Optional[str]=None,
20+
to_form: Optional[str]=None,
21+
standardized: Optional[bool]=False)-> QuantityLike:
22+
23+
if constant_name in _constants_synonyms:
24+
constant_name = _constants_synonyms[constant_name]
25+
26+
try:
27+
28+
value, unit = _constants[constant_name]
29+
output = quantity(value, unit, form=to_form, standardized=standardized)
30+
if to_unit is not None:
31+
output = convert(output, to_unit=to_unit)
32+
33+
return output
34+
35+
except:
36+
37+
raise ValueError
38+
39+
def show_constants()-> dict:
40+
41+
output = {}
42+
43+
for constant_name, constant_value in _constants.items():
44+
names = [constant_name]
45+
value = f'{constant_value[0]} {constant_value[1]}'
46+
for ii, jj in _constants_synonyms.items():
47+
if jj==constant_name:
48+
names.append(ii)
49+
output[tuple(names)]=value
50+
51+
return output
52+

0 commit comments

Comments
 (0)