gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 9edceeaa: Library (options.h): --quiet affects


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 9edceeaa: Library (options.h): --quiet affects un-given --minmapsize warning
Date: Fri, 2 Feb 2024 10:50:28 -0500 (EST)

branch: master
commit 9edceeaa40af1b6fa1265980dfa2f4e4755b7c58
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Library (options.h): --quiet affects un-given --minmapsize warning
    
    Until now, when any of the programs couldn't find the common '--minmapsize'
    option, but were givn the'--quiet' option, they would still print the
    warning about an un-given '--minmapsize'. This is a bug because the warning
    message suggests using '--quiet' so it is no longer printed.
    
    With this commit, a check of the value to '--quiet' has been added before
    this warning is printed: so if it is given, it the warning is not
    printed.
    
    Also, while trying to track down the problem, I noticed that some of the
    lines of 'bin/cosmiccal/ui.c' were a couple of characters larger than the
    standard 75 character limit of Gnuastro's coding conventions. They have
    also been fixed with this commit.
    
    This bug was reported by Boud Roukema.
    
    This fixes bug #65194.
---
 NEWS                         |  4 +--
 bin/cosmiccal/cosmiccal.c    | 68 +++++++++++++++++++++++---------------------
 doc/announce-acknowledge.txt |  1 +
 lib/options.c                |  2 +-
 4 files changed, 40 insertions(+), 35 deletions(-)

diff --git a/NEWS b/NEWS
index 51bd0bbf..1be7789d 100644
--- a/NEWS
+++ b/NEWS
@@ -283,8 +283,8 @@ See the end of the file for license conditions.
     by Sepideh Eskandarlou.
   - bug #65149: MakeCatalog '--frac-max*-*' measurements done without
     '--frac-max'; reported by Helena Domínguez Sánchez.
-
-
+  - bug #65194: --quiet does not disable the warning for un-given
+    minmapsize; reported by Boud Roukema.
 
 
 
diff --git a/bin/cosmiccal/cosmiccal.c b/bin/cosmiccal/cosmiccal.c
index fcb531d6..90d11ac9 100644
--- a/bin/cosmiccal/cosmiccal.c
+++ b/bin/cosmiccal/cosmiccal.c
@@ -157,8 +157,8 @@ cosmiccal(struct cosmiccalparams *p)
   if(isnan(p->redshift))
     {
       cosmiccal_print_input(p);
-      printf("\n\nPlease specify a redshift with the '--redshift' (or '-z') "
-             "option.\n");
+      printf("\n\nPlease specify a redshift with the '--redshift' (or "
+             "'-z') option.\n");
       return;
     }
 
@@ -177,28 +177,30 @@ cosmiccal(struct cosmiccalparams *p)
 
             case UI_KEY_AGENOW:
               printf("%f", gal_cosmology_age(0.0f, p->H0, p->olambda,
-                                              p->omatter, p->oradiation));
+                                             p->omatter, p->oradiation));
               break;
 
             case UI_KEY_CRITICALDENSITYNOW:
               printf("%e", gal_cosmology_critical_density(0.0f, p->H0,
-                                                           p->olambda,
-                                                           p->omatter,
-                                                           p->oradiation));
-              break;
-
-            case UI_KEY_PROPERDISTANCE:
-              printf("%f", gal_cosmology_proper_distance(p->redshift, p->H0,
                                                           p->olambda,
                                                           p->omatter,
                                                           p->oradiation));
               break;
 
+            case UI_KEY_PROPERDISTANCE:
+              printf("%f", gal_cosmology_proper_distance(p->redshift,
+                                                         p->H0,
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
+              break;
+
             case UI_KEY_ANGULARDIAMDIST:
-              printf("%f", gal_cosmology_angular_distance(p->redshift, p->H0,
-                                                           p->olambda,
-                                                           p->omatter,
-                                                           p->oradiation));
+              printf("%f", gal_cosmology_angular_distance(p->redshift,
+                                                          p->H0,
+                                                          p->olambda,
+                                                          p->omatter,
+                                                          p->oradiation));
               break;
 
             case UI_KEY_ARCSECTANDIST:
@@ -219,22 +221,23 @@ cosmiccal(struct cosmiccalparams *p)
               break;
 
             case UI_KEY_DISTANCEMODULUS:
-              printf("%f", gal_cosmology_distance_modulus(p->redshift, p->H0,
-                                                           p->olambda,
-                                                           p->omatter,
-                                                           p->oradiation));
+              printf("%f", gal_cosmology_distance_modulus(p->redshift,
+                                                          p->H0,
+                                                          p->olambda,
+                                                          p->omatter,
+                                                          p->oradiation));
               break;
 
             case UI_KEY_ABSMAGCONV:
               printf("%f", gal_cosmology_to_absolute_mag(p->redshift, p->H0,
-                                                          p->olambda,
-                                                          p->omatter,
-                                                          p->oradiation));
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
               break;
 
             case UI_KEY_AGE:
               printf("%f", gal_cosmology_age(p->redshift, p->H0, p->olambda,
-                                              p->omatter, p->oradiation));
+                                             p->omatter, p->oradiation));
               break;
 
             case UI_KEY_LOOKBACKTIME:
@@ -246,17 +249,18 @@ cosmiccal(struct cosmiccalparams *p)
               break;
 
             case UI_KEY_CRITICALDENSITY:
-              printf("%e", gal_cosmology_critical_density(p->redshift, p->H0,
-                                                           p->olambda,
-                                                           p->omatter,
-                                                           p->oradiation));
+              printf("%e", gal_cosmology_critical_density(p->redshift,
+                                                          p->H0,
+                                                          p->olambda,
+                                                          p->omatter,
+                                                          p->oradiation));
               break;
 
             case UI_KEY_VOLUME:
               printf("%f", gal_cosmology_comoving_volume(p->redshift, p->H0,
-                                                          p->olambda,
-                                                          p->omatter,
-                                                          p->oradiation));
+                                                         p->olambda,
+                                                         p->omatter,
+                                                         p->oradiation));
               break;
 
             case UI_KEY_USEDVELOCITY:
@@ -269,9 +273,9 @@ cosmiccal(struct cosmiccalparams *p)
               break;
 
             default:
-              error(EXIT_FAILURE, 0, "%s: a bug! Please contact us at %s to "
-                    "fix the problem. The code %d is not recognized as a "
-                    "single value calculation code", __func__,
+              error(EXIT_FAILURE, 0, "%s: a bug! Please contact us at %s "
+                    "to fix the problem. The code %d is not recognized as "
+                    "a single value calculation code", __func__,
                     PACKAGE_BUGREPORT, tmp->v);
             }
 
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 507bd5eb..af19bc11 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,6 +1,7 @@
 Alphabetically ordered list to acknowledge in the next release.
 
 Alberto Moreno Signes
+Boud Roukema
 Helena Domínguez Sánchez
 Ignacio Ruiz Cejudo
 Rahna Payyasseri Thanduparackal
diff --git a/lib/options.c b/lib/options.c
index 732ba6e3..dc2f8767 100644
--- a/lib/options.c
+++ b/lib/options.c
@@ -2862,7 +2862,7 @@ gal_options_read_low_level_checks(struct 
gal_options_common_params *cp)
     cp->numthreads=gal_threads_number();
 
   /* If 'minmapsize==0' and quiet isn't given, print a warning. */
-  if(cp->minmapsize==0)
+  if(cp->minmapsize==0 && cp->quiet==0)
     {
       fprintf(stderr, "\n\n"
               "========= WARNING =========\n"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]