Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml implementation #125

Merged
merged 4 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install pre-requisites
run: |
sudo apt-get update
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev gtk-doc-tools texlive texlive-bibtex-extra texlive-science texlive-publishers tex4ht perl libxml-libxml-perl
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libfyaml-dev libnlopt-dev libhdf5-dev gtk-doc-tools texlive texlive-bibtex-extra texlive-science texlive-publishers tex4ht perl libxml-libxml-perl
sudo pip install meson ninja pytest numpy
- name: Ensure clear Jupyter Notebooks
uses: ResearchSoftwareActions/EnsureCleanNotebooksAction@1.1
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install pre-requisites
run: |
sudo apt-get update
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran gcovr pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev python3-setuptools gtk-doc-tools
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran gcovr pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libfyaml-dev libnlopt-dev libhdf5-dev python3-setuptools gtk-doc-tools
pip install meson ninja pytest numpy
- name: Configure NumCosmo
run: meson setup build -Ddebug=true -Db_coverage=true -Db_lto=false --prefix=/usr || (cat build/meson-logs/meson-log.txt && exit 1)
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
python-version: '3.x'
- name: Brew install pre-requisites
run: |
brew install gobject-introspection gsl gmp mpfr fftw cfitsio nlopt gfortran gtk-doc glib openblas
brew install gobject-introspection gsl gmp mpfr fftw cfitsio libfyaml nlopt gfortran gtk-doc glib openblas
- name: Pip install pre-requisites
run: |
pip3 install meson ninja pytest numpy pygobject
Expand Down
17 changes: 15 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ dl_dep = dependency('dl', method: 'auto')
# Dependencies versions:
#######################################################################################

glib_req = '>= 2.44.0'
gobject_req = '>= 2.44.0'
glib_req = '>= 2.54.0'
gsl_req = '>= 2.4'
fftw_req = '>= 3.1.2'
cfitsio_req = '>= 3.25'
Expand Down Expand Up @@ -498,6 +497,20 @@ if cfitsio_dep.found()
numcosmo_conf.set('HAVE_CFITSIO', true)
endif

#######################################################################################
# Checking for libfyaml
#######################################################################################
message('Checking for libfyaml')

libfyaml_dep = dependency(
'libfyaml',
required: false,
)

if libfyaml_dep.found()
numcosmo_conf.set('HAVE_LIBFYAML', true)
endif

#######################################################################################
# Using internal libcuba:
#######################################################################################
Expand Down
31 changes: 0 additions & 31 deletions numcosmo/data/nc_data_reduced_shear_cluster_mass.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,37 +657,6 @@ ncm_hdf5_table_free (NcmHDF5Table *h5tb)
g_free (h5tb);
}

#if !GLIB_CHECK_VERSION (2, 54, 0)

static gboolean
g_ptr_array_find_with_equal_func (GPtrArray *haystack,
gconstpointer needle,
GEqualFunc equal_func,
guint *index_)
{
guint i;

g_return_val_if_fail (haystack != NULL, FALSE);

if (equal_func == NULL)
equal_func = g_direct_equal;

for (i = 0; i < haystack->len; i++)
{
if (equal_func (g_ptr_array_index (haystack, i), needle))
{
if (index_ != NULL)
*index_ = i;

return TRUE;
}
}

return FALSE;
}

#endif

gboolean
ncm_hdf5_table_has_col (NcmHDF5Table *h5tb, const gchar *col)
{
Expand Down
15 changes: 5 additions & 10 deletions numcosmo/math/ncm_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ ncm_cfg_init_full_ptr (gint *argc, gchar ***argv)
fftwf_set_timelimit (10.0);
#endif /* HAVE_FFTW3F */

#if !GLIB_CHECK_VERSION (2, 36, 0)
g_type_init ();
#endif

_log_stream = stdout;
_log_stream_err = stderr;

Expand Down Expand Up @@ -1067,14 +1063,13 @@ static guint nreg_model = 0;
void
ncm_cfg_register_obj (GType obj)
{
#if GLIB_CHECK_VERSION (2, 34, 0)
g_type_ensure (obj);
{
gpointer obj_class = g_type_class_ref (obj);

#endif /* GLIB >= 2.34*/
gpointer obj_class = g_type_class_ref (obj);

g_type_class_unref (obj_class);
nreg_model++;
g_type_class_unref (obj_class);
nreg_model++;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion numcosmo/math/ncm_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ ncm_matrix_class_init (NcmMatrixClass *klass)
*/
g_object_class_install_property (object_class, PROP_VALS,
g_param_spec_variant ("values", NULL, "values",
G_VARIANT_TYPE_ARRAY, NULL,
G_VARIANT_TYPE ("aad"), NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB));
}

Expand Down
31 changes: 0 additions & 31 deletions numcosmo/math/ncm_mset_catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,37 +2560,6 @@ ncm_mset_catalog_col_symb (NcmMSetCatalog *mcat, guint i)
return ncm_mset_fparam_symbol (self->mset, i - self->nadd_vals);
}

#if !GLIB_CHECK_VERSION (2, 54, 0)

static gboolean
g_ptr_array_find_with_equal_func (GPtrArray *haystack,
gconstpointer needle,
GEqualFunc equal_func,
guint *index_)
{
guint i;

g_return_val_if_fail (haystack != NULL, FALSE);

if (equal_func == NULL)
equal_func = g_direct_equal;

for (i = 0; i < haystack->len; i++)
{
if (equal_func (g_ptr_array_index (haystack, i), needle))
{
if (index_ != NULL)
*index_ = i;

return TRUE;
}
}

return FALSE;
}

#endif

/**
* ncm_mset_catalog_col_by_name:
* @mcat: a #NcmMSetCatalog
Expand Down