Skip to content

Commit 5163164

Browse files
committed
fix: Removed 'li' call in _gig_nbs.ado which was **really** slowing down ig_nbs()
1 parent 0f5118f commit 5163164

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

_gig_nbs.ado

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
capture program drop _gig_nbs
22
capture program drop Badsexvar_nbs
33
capture program drop Badsyntax_nbs
4-
*! version 0.4.0 (SJxx-x: dmxxxx)
4+
*! version 0.4.1 (SJxx-x: dmxxxx)
55
program define _gig_nbs
66
version 16
77
preserve
@@ -88,7 +88,7 @@ program define _gig_nbs
8888
}
8989
else Badsyntax_nbs
9090

91-
marksample touse
91+
marksample touse
9292

9393
local sex_type = "`:type `sex''"
9494
if !regexm("`sex_type'", "byte|str|int") {
@@ -133,11 +133,10 @@ program define _gig_nbs
133133
// Append, then interpolate in Mata (see gigs_ipolate_coeffs.mata)
134134
qui {
135135
tempvar n appended need_interp
136-
qui append using "`filepath'", gen(`appended')
136+
append using "`filepath'", gen(`appended')
137137
gen `n' = _n
138138
gen `need_interp' = 0
139139
replace `need_interp' = `appended' == 0
140-
li nbsMSNT_*
141140
mata gigs_ipolate_coeffs(
142141
"nbsMSNT_gest_age", ///
143142
"nbsMSNT_sex", ///
@@ -320,8 +319,8 @@ program define _gig_nbs
320319
}
321320

322321
qui {
323-
gen nbsBC_sexacronym = "`acronym'_M" if `sex' == "`male'"
324-
replace nbsBC_sexacronym = "`acronym'_F" if `sex' == "`female'"
322+
gen nbsBC_sexacronym = "`acronym'_M" if `sex' == "`male'"
323+
replace nbsBC_sexacronym = "`acronym'_F" if `sex' == "`female'"
325324
merge m:1 nbsBC_sexacronym using "`filepath'", ///
326325
nogenerate keep(1 3)
327326
sort `n'
@@ -358,10 +357,10 @@ program define _gig_nbs
358357
}
359358
qui {
360359
if (`use_extended' == 1) {
361-
cap gen `check_ga' = `gest_days' >= 154 & `gest_days' <= 314
360+
cap gen byte `check_ga' = `gest_days' >= 154 & `gest_days' <= 314
362361
}
363362
else {
364-
cap gen `check_ga' = `gest_days' >= 168 & `gest_days' <= 300
363+
cap gen byte `check_ga' = `gest_days' >= 168 & `gest_days' <= 300
365364
}
366365
gen `check_sex' = `sex' == "`male'" | `sex' == "`female'"
367366
if "`sex_was_str'" == "0" destring(`sex'), replace

gigs.pkg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
v 1.1.1
1+
v 1.1.2
22
d 'GIGS': Fetal, neonatal, and infant growth assessment using international growth standards
33
d
44
d gigs provides a single, simple interface for working with outputs from the INTERGROWTH-21st project and the WHO Child Growth standards. You will find functions for converting between anthropometric measures (e.g. weight or length) to z-scores and centiles, and the inverse. Also included is a command for classifying newborn and infant growth according to published z-score/centile cut-offs.
55
d
6-
d Distribution-Date: 20241120
6+
d Distribution-Date: 20241126
77
d License: GNU General Public License v3.0
88
d
99
F _gig_fet.ado

gigs_zscore.ado

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
capture prog drop gigs_zscore
2-
*! version 0.2.0 (SJxx-x: dmxxxx)
2+
*! version 0.2.1 (SJxx-x: dmxxxx)
33
program gigs_zscore
44
version 16
55
preserve
@@ -67,7 +67,6 @@ program gigs_zscore
6767
tempvar use_ig_nbs use_ig_png use_who_gs
6868
gigs_zscoring_lgls `use_ig_nbs' `use_ig_png' `use_who_gs' ///
6969
if `touse', age_days(`age_days') gest_days(`gest_days') id(`id')
70-
noi di "`use_ig_nbs' `use_ig_png' `use_who_gs'"
7170
}
7271
else {
7372
local use_ig_nbs : word 1 of `gigs_lgls'

ig_nbs.sthlp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{smcl}
2-
{* *! version 0.6.0 31 Oct 2024}{...}
2+
{* *! version 0.6.1 26 Nov 2024}{...}
33
{vieweralsosee "" "--"}{...}
4-
{vieweralsosee "gigs: Classification functions" "help classify_sfga"}{...}
4+
{vieweralsosee "gigs: Classification command" "help gigs_classify_growth"}{...}
55
{viewerjumpto "Syntax" "ig_nbs##syntax"}{...}
66
{viewerjumpto "Description" "ig_nbs##description"}{...}
77
{viewerjumpto "Functions" "ig_nbs##functions"}{...}

make.do

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// DO NOT FORGET to update the version of the package, if changed!
44
// for more information visit http://github.com/haghish/github
55

6-
make gigs, replace toc pkg version(1.1.1) ///
6+
make gigs, replace toc pkg version(1.1.2) ///
77
license("GNU General Public License v3.0") ///
88
author("S. R. Parker") ///
99
affiliation("London School of Hygiene & Tropical Medicine") ///

stata.toc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
v 1.1.1
1+
v 1.1.2
22
d Materials by S. R. Parker
33
d London School of Hygiene & Tropical Medicine
44

0 commit comments

Comments
 (0)