[Stacomir-commits] r301 - in pkg/stacomir: R inst/tests/testthat

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 13 17:01:37 CET 2017


Author: briand
Date: 2017-03-13 17:01:36 +0100 (Mon, 13 Mar 2017)
New Revision: 301

Modified:
   pkg/stacomir/R/BilanFonctionnementDC.r
   pkg/stacomir/R/BilanFonctionnementDF.r
   pkg/stacomir/R/BilanMigrationInterAnnuelle.r
   pkg/stacomir/R/BilanMigrationMult.r
   pkg/stacomir/R/BilanOperation.r
   pkg/stacomir/R/funtraitement_poids.r
   pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
Log:
MAJOR CHANGE : for all classes except BilanAnnuel, the period now extends only on dates starting before the end of the period,
not ending before the end of the period. This will bring back to the Bilans some missing numbers that corresponded to period
starting before the end of the year, and finishing after the end of the year.

Modified: pkg/stacomir/R/BilanFonctionnementDC.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDC.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/BilanFonctionnementDC.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -52,7 +52,7 @@
 					" FROM  ",get("sch",envir=envir_stacomi),"t_periodefonctdispositif_per per",
 					" INNER JOIN ref.tr_typearretdisp_tar tar ON tar.tar_code=per.per_tar_code",sep="")
 			req at colonnedebut<-"per_date_debut"
-			req at colonnefin<-"per_date_fin"
+			req at colonnefin<-"per_date_debut"
 			req at datedebut<-object at horodatedebut@horodate
 			req at datefin<-object at horodatefin@horodate
 			req at order_by<-"ORDER BY per_date_debut"

Modified: pkg/stacomir/R/BilanFonctionnementDF.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDF.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/BilanFonctionnementDF.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -56,7 +56,7 @@
 					" FROM  ",get("sch",envir=envir_stacomi),"t_periodefonctdispositif_per per",
 					" INNER JOIN ref.tr_typearretdisp_tar tar ON tar.tar_code=per.per_tar_code",sep="")
 			req at colonnedebut="per_date_debut"
-			req at colonnefin="per_date_fin"
+			req at colonnefin="per_date_debut"
 			req at order_by="ORDER BY per_date_debut"
 			req at datedebut<-object at horodatedebut@horodate
 			req at datefin<-object at horodatefin@horodate

Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -186,7 +186,7 @@
 							bM=new("BilanMigration")
 							for (Y in differing_years){
 								# Y=differing_years[1]
-								funout(gettextf("Running Bilanmigraton to correct data for year %s",Y))
+								funout(gettextf("Running Bilanmigration to correct data for year %s",Y))
 								bM=choice_c(bM,
 										dc=dic[i],
 										taxons=object at taxons@data$tax_nom_latin,

Modified: pkg/stacomir/R/BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/BilanMigrationMult.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/BilanMigrationMult.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -273,7 +273,7 @@
 			req=new("RequeteODBCwheredate")
 			req at baseODBC<-get("baseODBC", envir=envir_stacomi)			
 			req at colonnedebut<-"ope_date_debut"
-			req at colonnefin<-"ope_date_fin"
+			req at colonnefin<-"ope_date_debut"
 			req at datedebut=as.POSIXlt(bilanMigrationMult at pasDeTemps@dateDebut)
 			req at datefin=as.POSIXlt(DateFin(bilanMigrationMult at pasDeTemps))
 			dc = vector_to_listsql(bilanMigrationMult at dc@dc_selectionne)

Modified: pkg/stacomir/R/BilanOperation.r
===================================================================
--- pkg/stacomir/R/BilanOperation.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/BilanOperation.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -49,7 +49,7 @@
 			req at baseODBC<-get("baseODBC",envir=envir_stacomi)
 			lesdc<-object at dc@dc_selectionne			
 			req at colonnedebut="ope_date_debut"
-			req at colonnefin="ope_date_fin"
+			req at colonnefin="ope_date_debut"
 			req at order_by="ORDER BY ope_dic_identifiant, ope_date_debut"
 			req at datedebut<-object at horodatedebut@horodate
 			req at datefin<-object at horodatefin@horodate

Modified: pkg/stacomir/R/funtraitement_poids.r
===================================================================
--- pkg/stacomir/R/funtraitement_poids.r	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/R/funtraitement_poids.r	2017-03-13 16:01:36 UTC (rev 301)
@@ -48,7 +48,7 @@
 	req at datedebut<-as.POSIXlt(time.sequence[min(index)])
 	req at datefin<-as.POSIXlt(time.sequence[max(index)])
 	req at colonnedebut<-"coe_date_debut"
-	req at colonnefin<-"coe_date_fin"
+	req at colonnefin<-"coe_date_debut"
 	req at and<-c("and coe_tax_code='2038'","and coe_std_code='CIV'")
 	req at order_by<-"order by coe_date_debut"
 	req<-stacomirtools::connect(req)

Modified: pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
===================================================================
--- pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R	2017-03-13 15:33:47 UTC (rev 300)
+++ pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R	2017-03-13 16:01:36 UTC (rev 301)
@@ -117,7 +117,7 @@
 			# using setAs to transform the bilanMigration into BilanMigrationInterAnnuelle
 			bili=as(bM_Arzal,"BilanMigrationInterAnnuelle")			
 			bila=as(bili,"BilanAnnuels")
-			bila<-connect(bila)
+			bila<-connect(bila,silent=TRUE)
 			# we test that the BilanAnnuel has the same number as
 			# BilanMigration
 			expect_equal(
@@ -127,7 +127,7 @@
 number in the BilanAnnuel class"
 					)
 		
-			bili<-connect(bili,check=TRUE)
+			bili<-connect(bili,check=TRUE,silent=TRUE)
 			expect_equal(
 			sum(bM_Arzal at calcdata$dc_5$data$Effectif_total),	
 			sum(bili at data$bjo_valeur[bili at data$bjo_labelquantite=="Effectif_total"]),			



More information about the Stacomir-commits mailing list