Skip to content

Commit

Permalink
Merge pull request #17 from MilanSkocic/dev
Browse files Browse the repository at this point in the history
1.1.0
  • Loading branch information
MilanSkocic authored May 28, 2024
2 parents c0a4c55 + e74b4da commit 725816a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 52 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* C API and Python wrapper moved to their own repositories.
* [C wrapper](https://github.com/MilanSkocic/codata-capi)
* [Python wrapper](https://github.com/MilanSkocic/codata-py)
* API break: C API is no more provided by default.
* API break: C API is no more provided by default. Use the optional C wrapper.
* Code cleanup
* Documentation update

Expand Down
51 changes: 0 additions & 51 deletions scripts/gen_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def write_module_start(f, year):
def write_year(f, year):
suffix = get_suffix(year)
f.write(f"integer(int32), parameter, public :: YEAR{suffix:s} = {year:s} !! Year of release." + newline)
# f.write(f"integer(int32), protected, public, bind(C, name=\"YEAR{suffix}\") :: capi_YEAR{suffix:s} = YEAR{suffix:s} !capi" + newline)
f.write(newline)

def write_constant(f, var, name, value, uncertainty, unit, year, count):
Expand All @@ -42,56 +41,6 @@ def write_constant(f, var, name, value, uncertainty, unit, year, count):
f"{value:s}_dp, {uncertainty:s}_dp, &" + newline+\
f"\"{unit:s}\") !! {name:s}" + newline)


# ctag = "!capi"
#
# # NAMES
# name_list = list(map(lambda s: '"' + s + '"', name))
# cname = ['\" \"'] * cname_len
# cname[0:len(name)] = name_list[:]
# cname[len(name)] = "c_null_char"

# indexes = (0, 10, 20, 30, 40, 50)
# cnames = []
# for i in range(0, len(indexes)-1):
# cnames.append(", ".join(cname[indexes[i]: indexes[i+1]]))
# cnames.append(", ".join(cname[indexes[-1]:]))
#
# f.write(f"type(capi_codata_constant_type), protected, public, bind(C, name=\"{var:s}{suffix}\") ::&" + ctag + newline)
# f.write(f"capi_{count:d}{suffix} = capi_codata_constant_type([ &" + ctag + newline)
#
# # last not comma at the end
# for _cname in cnames[:-1]:
# f.write(f"{_cname:s}, &" + ctag + newline)
# _cname = cnames[-1]
# f.write(f"{_cname:s} &" + ctag + newline)
#
# # VALUES AND UNCERTAINTY
# f.write("], &" + ctag + newline +\
# f"{value:s}_dp, {uncertainty:s}_dp, &" + ctag + newline)
#
#
# # UNITS
# unit_list = list(map(lambda s: '"' + s + '"', unit))
# cname = ['\" \"'] * cunit_len
# cname[0:len(unit)] = unit_list[:]
# cname[len(unit)] = "c_null_char"
#
# indexes = (0, 10, 20)
# cnames = []
# for i in range(0, len(indexes)-1):
# cnames.append(", ".join(cname[indexes[i]: indexes[i+1]]))
# cnames.append(", ".join(cname[indexes[-1]:]))
#
# # last not comma at the end
# f.write("[ &" + ctag + newline)
# for _cname in cnames[:-1]:
# f.write(f"{_cname:s}, &" + ctag + newline)
# _cname = cnames[-1]
# f.write(f"{_cname:s} &" + ctag + newline)
# f.write("])" + ctag + newline)
#

f.write(newline)

def write_module_end(f, year):
Expand Down

0 comments on commit 725816a

Please sign in to comment.