Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move scenario features data to shared lib #363

Merged
merged 1 commit into from
Jul 22, 2021

Conversation

kgajowy
Copy link
Contributor

@kgajowy kgajowy commented Jul 22, 2021

Figured out that adding more would be hard to read the diff, thus adding standalone PR for moving things around and setting really dummy shell/plan for putting the data to the db.

@vercel
Copy link

vercel bot commented Jul 22, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

marxan – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan/78tk2eGyvgyLjTcmuEgpSwLqPhSg
✅ Preview: https://marxan-git-feat-marxan-521-marxan-533-output-mvxxxx-vizzuality1.vercel.app

marxan-storybook – ./app

🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/5TfsNczqHhHGscKRpZUPjq6Xfchq
✅ Preview: https://marxan-storybook-git-feat-marxan-521-marxan-d38f6d-vizzuality1.vercel.app

Comment on lines +18 to +36
async from(
outputDirectory: string,
scenarioId: string,
): Promise<ScenarioFeatureData[]> {
const planningUnits = await this.scenarioFeatureData.findAndCount({
where: {
scenarioId,
},
select: ['id', 'featureId'],
});
const _mapping = planningUnits[0].reduce<FeatureIdToScenarioFeatureData>(
(previousValue, sfd) => {
previousValue[sfd.featureId] = sfd.id;
return previousValue;
},
{},
);
console.log(`--- scenario features data mapping`, _mapping);
return [];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dummy placeholder for next PR

@kgajowy kgajowy marked this pull request as ready for review July 22, 2021 08:43
@kgajowy kgajowy requested a review from Dyostiq July 22, 2021 08:44
@@ -46,11 +48,21 @@ export class GeoOutputRepository {
const planningUnitsState: PlanningUnitsSelectionState = await this.planningUnitsStateCalculator.consume(
solutionsStream,
);

// TODO grab data from ScenarioFeaturesDataService
const _sfds = await this.scenarioFeaturesDataReader.from(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const _sfds = await this.scenarioFeaturesDataReader.from(
const _scenarioFeaturesDataStream = await this.scenarioFeaturesDataReader.from(

@kgajowy kgajowy merged commit 63cf654 into develop Jul 22, 2021
@kgajowy kgajowy deleted the feat/MARXAN-521-MARXAN-533-output-mvxxxx branch July 22, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants