Skip to content

Commit

Permalink
Move case-repository from ipst-core to ipst
Browse files Browse the repository at this point in the history
  • Loading branch information
yichen88 committed Oct 3, 2017
1 parent 5e0a0c9 commit d9793f0
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Maven projects
/ampl-export/target/
/case-projector/target
/case-repository/target/
/distribution/target
/dymola-integration/target/
/EU2Mod_MB/target/
Expand Down
49 changes: 49 additions & 0 deletions case-repository/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2016, RTE (http://www.rte-france.com)
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>case-repository</artifactId>
<name>Case repository</name>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>iidm-converter-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>computation</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package eu.itesla_project.cases;

import eu.itesla_project.iidm.network.Country;
import eu.itesla_project.iidm.network.Network;
import org.joda.time.DateTime;
import org.joda.time.Interval;

import java.util.List;
import java.util.Set;

/**
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface CaseRepository {

/**
* Load a case from the repository.
*
* @param date date of the case
* @param type type of the case, snapshot (SN) or forecast (FO)
* @param country case perimeter, merge if null
* @return a case
*/
List<Network> load(DateTime date, CaseType type, Country country);

/**
* Check if the all the data of a case is available
*
* @param date date of the case
* @param type type of the case, snapshot (SN) or forecast (FO)
* @param country case perimeter, merge if null
* @return true if all the data of a case is available, false otherwise
*/
boolean isDataAvailable(DateTime date, CaseType type, Country country);

Set<DateTime> dataAvailable(CaseType type, Set<Country> countries, Interval interval);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package eu.itesla_project.cases;

import eu.itesla_project.computation.ComputationManager;

/**
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public interface CaseRepositoryFactory {

CaseRepository create(ComputationManager computationManager);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package eu.itesla_project.cases;

/**
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public enum CaseType {
SN,
FO
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright (c) 2016, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package eu.itesla_project.cases;

import org.junit.Test;

/**
* @author Mathieu Bague <mathieu.bague at rte-france.com>
*/
public class CoverageTest {

@Test
public void testNothing() {
}
}
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<modules>
<module>ampl-export</module>
<module>case-projector</module>
<module>case-repository</module>
<module>distribution</module>
<module>dymola-integration</module>
<module>EU2Mod_MB</module>
Expand Down Expand Up @@ -545,7 +546,7 @@
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
Expand Down

0 comments on commit d9793f0

Please sign in to comment.