<commit_before>package roart.iclij.verifyprofit;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.jupiter.api.Test;

import roart.testdata.TestData;

public class VerifyProfitTest {
    @Test
    public void test() {
        TestData testData = new TestData();
        Map<String, List<List<Double>>> categoryValueMap = testData.getAbnormCatValMap();
        List<String> stockDates = testData.getStockDates(LocalDate.now(), 3, false);
        int firstidx = 2; 
        int lastidx = 0; 
        Double margin = 9.0;
        Set<String> excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
        margin = 0.0;
        excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
    }
}<commit_msg>Change for remove stocks with abnormal change due to splits etc (I288).<commit_after>package roart.iclij.verifyprofit;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.jupiter.api.Test;

import roart.testdata.TestData;

public class VerifyProfitTest {
    @Test
    public void test() {
        TestData testData = new TestData();
        Map<String, List<List<Double>>> categoryValueMap = testData.getAbnormCatValMap();
        List<String> stockDates = testData.getStockDates(LocalDate.now(), 3, false);
        int firstidx = 2; 
        int lastidx = 0; 
        Double margin = 9.0;
        Set<String> excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
        margin = 0.0;
        excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
    }
    
    @Test
    public void testWithHoles() {
        TestData testData = new TestData();
        Map<String, List<List<Double>>> categoryValueMap = testData.getAbnormWithHolesCatValMap();
        List<String> stockDates = testData.getStockDates(LocalDate.now(), 4, false);
        int firstidx = 3; 
        int lastidx = 0; 
        Double margin = 9.0;
        Set<String> excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
        margin = 0.0;
        excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
    }
}
{'fraction_non_alphanumeric': 0.11480804387568556, 'fraction_numerical': 0.010968921389396709, 'mean_word_length': 3.420032310177706, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2282551', 'n_tokens_mistral': 844, 'n_tokens_neox': 827, 'n_words': 192}