Skip to content

Commit

Permalink
Update CHANGELOG and VERSION.
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanSkocic committed Dec 10, 2024
1 parent 70a90cc commit c3729bd
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 51 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2.1.0

* Roll back to C API in Fortran code: easier maintenance.
* Roll back to compiled C extension: easier maintenance.

Full changelog available at [github](https://github.com/milanskocic/codata/releases)

**Not released**


# 2.0.1

* Fix bug in version for Fortran code.
Expand Down
20 changes: 7 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ else
btype=release
endif

ifeq ($(PLATFORM), windows)
PY=py
endif
ifeq ($(PLATFORM), linux)
PY=python
AW=auditwheel repair --plat manylinux_2_31_x86_64 ./dist/*.whl
endif
ifeq ($(PLATFORM), darwin)
PY=python
endif


GEN_F=./scripts/gen_fortran.py
GEN_C=./scripts/gen_capi.py
Expand All @@ -32,7 +21,7 @@ GEN_STDLIB=./scripts/gen_stdlib.py

AST_SRC=$(wildcard ./data/*.toml)
F_SRC=$(patsubst ./data/%.toml, ./src/%.f90, $(AST_SRC))
C_SRC=$(patsubst ./data/%.toml, ./src/capi_%.f90, $(AST_SRC))
C_SRC=$(patsubst ./data/%.toml, ./src/%_capi.f90, $(AST_SRC))
C_HEADERS=$(patsubst ./data/%.toml, ./include/%.h, $(AST_SRC))
C_HEADER=./include/$(NAME).h
SRC_FYPP=$(wildcard ./src/*.fypp)
Expand All @@ -58,14 +47,15 @@ sources: $(SRC_FYPP_F90) $(F_SRC) $(C_SRC) $(C_HEADER) $(STDLIB)
./src/%.f90: ./data/%.toml
$(PY) $(GEN_F) $< $@

./src/capi_%.f90: ./data/%.toml
./src/%_capi.f90: ./data/%.toml
$(PY) $(GEN_C) $< $@

./include/%.h: ./data/%.toml
$(PY) $(GEN_HEADERS) $< $@

$(C_HEADER): $(C_HEADERS)
$(PY) $(GEN_HEADER) $^ -o $@
rm -rf $(C_HEADERS)

./src/%.f90: ./src/%.fypp
fypp -I ./include $< $@
Expand Down Expand Up @@ -157,4 +147,8 @@ clean:
rm -rf $(F_SRC) $(C_SRC) $(C_HEADERS) $(C_HEADER) ./src/codata_version.f90 $(SRC_FYPP_F90) $(STDLIB)
fpm clean --all
rm -rf API-doc/*

py: $(LIBNAME)
make install prefix=py/src/py$(NAME)
make -C py
# ---------------------------------------------------------------------
39 changes: 18 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

# Introduction

`codata` is a Fortran library providing the latest codata constants (2022) and
older values (2018, 2014 and 2010).
The raw codata are taken from http://physics.nist.gov/constants.
The constants (values and uncertainties) are implemented as double precision reals.
`codata` is a Fortran library providing the standard and abridged atomic weights,
the isotopic abundance and the isotopes' standard atomic weights.
The data are taken from http://ciaaw.org.
C API allows usage from C, or can be used as a basis for other wrappers.
Python wrapper allows easy usage from Python.

The names are quite long and can be aliased with shorter names.

Expand All @@ -22,11 +23,6 @@ codata = { git="https://github.com/MilanSkocic/codata.git" }

* If you only need sources for the codata constants that you can integrate directly in your sources you may be interested by https://github.com/vmagnin/fundamental_constants.

**Extra:**

* Pure python code is provided in the `py` folder. See `py/README.md`.
* Pure C code is provided in the `C` folder. See `C/README.md`


# Dependencies

Expand Down Expand Up @@ -73,16 +69,16 @@ implicit none
print '(A)', '########## EXAMPLE IN FORTRAN ##########'
print '(A)', '########## VERSION ##########'
print '(A)', '# VERSION'
print *, "version = ", get_version()
print '(A)', '########## CONSTANTS ##########'
print '(A)', '# CONSTANTS'
print *, "c = ", SPEED_OF_LIGHT_IN_VACUUM%value
print '(A)', '########## UNCERTAINTY ##########'
print '(A)', '# UNCERTAINTY'
print *, "u(c) = ", SPEED_OF_LIGHT_IN_VACUUM%uncertainty
print '(A)', '########## OLDER VALUES ##########'
print '(A)', '# OLDER VALUES'
print '(A, F23.16)', "Mu_2022(latest) = ", MOLAR_MASS_CONSTANT%value
print '(A, F23.16)', "Mu_2018 = ", MOLAR_MASS_CONSTANT_2018%value
print '(A, F23.16)', "Mu_2014 = ", MOLAR_MASS_CONSTANT_2014%value
Expand All @@ -99,16 +95,16 @@ int main(void){

printf("########## EXAMPLE IN C ##########n");

printf("%sn","########## VERSION ##########");
printf("%sn","# VERSION");
printf("version = %sn", codata_get_version());

printf("%sn","########## CONSTANTS ##########");
printf("%sn","# CONSTANTS");
printf("c = %fn", SPEED_OF_LIGHT_IN_VACUUM.value);

printf("%sn","########## UNCERTAINTY ##########");
printf("%sn","# UNCERTAINTY");
printf("u(c) = %fn", SPEED_OF_LIGHT_IN_VACUUM.uncertainty);

printf("%sn","########## OLDER VALUES ##########");
printf("%sn","# OLDER VALUES");
printf("Mu_2022(latest) = %23.16fn", MOLAR_MASS_CONSTANT.value);
printf("Mu_2018 = %23.16fn", MOLAR_MASS_CONSTANT_2018.value);
printf("Mu_2014 = %23.16fn", MOLAR_MASS_CONSTANT_2014.value);
Expand All @@ -123,16 +119,17 @@ import sys
sys.path.insert(0, "../src/")
import pycodata
print("########## VERSION ##########")
print("########## EXAMPLE IN PYTHON ##########")
print("# VERSION")
print(f"version = {pycodata.__version__}")
print("########## constants ##########")
print("# Constants")
print(f"c =", pycodata.SPEED_OF_LIGHT_IN_VACUUM["value"])
print("########## UNCERTAINTY ##########")
print("# UNCERTAINTY")
print(f"u(c) = ", pycodata.SPEED_OF_LIGHT_IN_VACUUM["uncertainty"])
print("########## OLDER VALUES ##########")
print("# OLDER VALUES")
print(f"Mu_2022 = ", pycodata.MOLAR_MASS_CONSTANT["value"])
print(f"Mu_2018 = ", pycodata.codata_constants_2018.MOLAR_MASS_CONSTANT_2018["value"])
print(f"Mu_2014 = ", pycodata.codata_constants_2014.MOLAR_MASS_CONSTANT_2014["value"])
Expand Down
14 changes: 5 additions & 9 deletions README_TEMPLATE.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Introduction

`codata` is a Fortran library providing the latest codata constants (2022) and
older values (2018, 2014 and 2010).
The raw codata are taken from http://physics.nist.gov/constants.
The constants (values and uncertainties) are implemented as double precision reals.
`codata` is a Fortran library providing the standard and abridged atomic weights,
the isotopic abundance and the isotopes' standard atomic weights.
The data are taken from http://ciaaw.org.
C API allows usage from C, or can be used as a basis for other wrappers.
Python wrapper allows easy usage from Python.

The names are quite long and can be aliased with shorter names.

Expand All @@ -21,11 +22,6 @@ add the following to your `fpm.toml` file:

* If you only need sources for the codata constants that you can integrate directly in your sources you may be interested by https://github.com/vmagnin/fundamental_constants.

**Extra:**

* Pure python code is provided in the `py` folder. See `py/README.md`.
* Pure C code is provided in the `C` folder. See `C/README.md`


# Dependencies

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.1.0
12 changes: 5 additions & 7 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ function prepare_readme () {
echo "\`\`\`" >> $fpath_readme
}

LIBNAME="libcodata"
NAME="codata"
LIBNAME="lib$NAME"
PYNAME="py$NAME"
PY_SRC="./src/$PYNAME"

# environment variables
FC=gfortran
CC=gcc
PY=python
BUILD_DIR="./build"
INCLUDE_DIR="./include"
FPM_FFLAGS="-std=f2008 -pedantic -Wall -Wextra"
Expand All @@ -58,6 +59,7 @@ EXT=".so"

echo -n "Detecting platform..."
if [[ "$OSTYPE" == "msys" ]]; then
PY=py -
DEFAULT_INSTALL_DIR="${APPDATA//\\//}/local"
PLATFORM="windows"
ROOT=$ROOTWINDOWS
Expand All @@ -84,9 +86,9 @@ export DEFAULT_INSTALL_DIR
export BUILD_DIR
export INCLUDE_DIR
export PY_SRC
export C_SRC
export FC
export CC
export PY
export EXT
echo "OK"

Expand All @@ -111,13 +113,9 @@ echo "* PY_SRC=" $PY_SRC
echo "##### COMPILERS #####"
echo "* FC=" $FC
echo "* CC=" $CC
echo "* PY=" $PY


echo -n "Copying version and license for C..."
cp -f VERSION ./C/VERSION
cp -f LICENSE ./C/LICENSE
echo "OK"

echo -n "Copying version and license for python..."
cp -f VERSION ./py/VERSION
cp -f LICENSE ./py/LICENSE
Expand Down

0 comments on commit c3729bd

Please sign in to comment.