From 961ea84d4e9d7a069ca3460f983a99dd89bbb864 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Thu, 11 Apr 2024 12:00:38 -0400 Subject: [PATCH] reorganize folder structure For e-mission-common to function as both a JS and Python package (compatible with npm and pip respectively), there need to be a few changes. First, the directory that contains __init__.js needs to be the name of the Python package. We will call it `emcommon` and rename the directory accordingly. Second, it's simpler and easier to just have the npm package at the same level as the Python package. So instead of tucking it away under the /js directory, we can keep package.json at the root level. The compiled JS files can go under a directory called `emcommon_translated_js`. Moved all these files, updated imports, updated compile_to_js.sh, updated README. --- README.md | 6 +-- compile_to_js.sh | 2 +- {src => emcommon}/__init__.py | 2 +- {src => emcommon}/logger.py | 0 .../active_travel_calculations.py | 0 .../active_travel/standard_met_mode_map.py | 0 .../metrics/carbon/carbon_calculations.py | 0 .../metrics/metrics_summaries.py | 0 .../metrics/surveys/surveys_summary.py | 0 .../survey/conditional_surveys.py | 0 {src => emcommon}/util.py | 0 .../__init__.js | 4 +- emcommon_translated_js/__init__.project | 1 + .../logger.js | 2 +- ...ctive_travel.active_travel_calculations.js | 2 +- ...ics.active_travel.standard_met_mode_map.js | 2 +- .../metrics.carbon.carbon_calculations.js | 2 +- .../metrics.metrics_summaries.js | 2 +- .../metrics.surveys.surveys_summary.js | 2 +- .../org.transcrypt.__runtime__.js | 2 +- .../survey.conditional_surveys.js | 2 +- js/index.js => index.js | 2 +- js/__translated_src__/__init__.project | 1 - js/__translated_src__/util.js | 45 ------------------- js/package.json => package.json | 0 25 files changed, 17 insertions(+), 62 deletions(-) rename {src => emcommon}/__init__.py (78%) rename {src => emcommon}/logger.py (100%) rename {src => emcommon}/metrics/active_travel/active_travel_calculations.py (100%) rename {src => emcommon}/metrics/active_travel/standard_met_mode_map.py (100%) rename {src => emcommon}/metrics/carbon/carbon_calculations.py (100%) rename {src => emcommon}/metrics/metrics_summaries.py (100%) rename {src => emcommon}/metrics/surveys/surveys_summary.py (100%) rename {src => emcommon}/survey/conditional_surveys.py (100%) rename {src => emcommon}/util.py (100%) rename {js/__translated_src__ => emcommon_translated_js}/__init__.js (92%) create mode 100644 emcommon_translated_js/__init__.project rename {js/__translated_src__ => emcommon_translated_js}/logger.js (97%) rename {js/__translated_src__ => emcommon_translated_js}/metrics.active_travel.active_travel_calculations.js (98%) rename {js/__translated_src__ => emcommon_translated_js}/metrics.active_travel.standard_met_mode_map.js (98%) rename {js/__translated_src__ => emcommon_translated_js}/metrics.carbon.carbon_calculations.js (98%) rename {js/__translated_src__ => emcommon_translated_js}/metrics.metrics_summaries.js (98%) rename {js/__translated_src__ => emcommon_translated_js}/metrics.surveys.surveys_summary.js (98%) rename {js/__translated_src__ => emcommon_translated_js}/org.transcrypt.__runtime__.js (99%) rename {js/__translated_src__ => emcommon_translated_js}/survey.conditional_surveys.js (98%) rename js/index.js => index.js (86%) delete mode 100644 js/__translated_src__/__init__.project delete mode 100644 js/__translated_src__/util.js rename js/package.json => package.json (100%) diff --git a/README.md b/README.md index 4800976..d92089b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,6 @@ This repository uses the [Transcrypt](https://www.transcrypt.org/) library to co ## To contribute -1. Make your changes to Python code under the `src` directory. -2. Run `compile_to_js.sh` to build the JavaScript. This will produce output JS files in the `__js__` directory. -3. Commit your changes from both the `src` and `__js__` directories. +1. Make your changes to Python code under the `emcommon` directory. +2. Run `compile_to_js.sh` to build the JavaScript. This will produce output JS files in the `emcommon_translated_js` directory. +3. Commit your changes from both the `emcommon` and `emcommon_translated_js` directories. diff --git a/compile_to_js.sh b/compile_to_js.sh index 3b71647..1dbb448 100644 --- a/compile_to_js.sh +++ b/compile_to_js.sh @@ -1,2 +1,2 @@ #!/bin/bash -transcrypt --nomin --ecom ./src/__init__.py -od ../js/__translated_src__ +transcrypt --nomin --ecom ./emcommon/__init__.py -od ../emcommon_translated_js diff --git a/src/__init__.py b/emcommon/__init__.py similarity index 78% rename from src/__init__.py rename to emcommon/__init__.py index a12b193..c412713 100644 --- a/src/__init__.py +++ b/emcommon/__init__.py @@ -1,5 +1,5 @@ import logger as Logger import metrics.metrics_summaries as MetricsSummaries -import src.metrics.surveys.surveys_summary as SurveysSummary +import metrics.surveys.surveys_summary as SurveysSummary import metrics.carbon.carbon_calculations as CarbonCalculations import metrics.active_travel.active_travel_calculations as ActiveTravelCalculations diff --git a/src/logger.py b/emcommon/logger.py similarity index 100% rename from src/logger.py rename to emcommon/logger.py diff --git a/src/metrics/active_travel/active_travel_calculations.py b/emcommon/metrics/active_travel/active_travel_calculations.py similarity index 100% rename from src/metrics/active_travel/active_travel_calculations.py rename to emcommon/metrics/active_travel/active_travel_calculations.py diff --git a/src/metrics/active_travel/standard_met_mode_map.py b/emcommon/metrics/active_travel/standard_met_mode_map.py similarity index 100% rename from src/metrics/active_travel/standard_met_mode_map.py rename to emcommon/metrics/active_travel/standard_met_mode_map.py diff --git a/src/metrics/carbon/carbon_calculations.py b/emcommon/metrics/carbon/carbon_calculations.py similarity index 100% rename from src/metrics/carbon/carbon_calculations.py rename to emcommon/metrics/carbon/carbon_calculations.py diff --git a/src/metrics/metrics_summaries.py b/emcommon/metrics/metrics_summaries.py similarity index 100% rename from src/metrics/metrics_summaries.py rename to emcommon/metrics/metrics_summaries.py diff --git a/src/metrics/surveys/surveys_summary.py b/emcommon/metrics/surveys/surveys_summary.py similarity index 100% rename from src/metrics/surveys/surveys_summary.py rename to emcommon/metrics/surveys/surveys_summary.py diff --git a/src/survey/conditional_surveys.py b/emcommon/survey/conditional_surveys.py similarity index 100% rename from src/survey/conditional_surveys.py rename to emcommon/survey/conditional_surveys.py diff --git a/src/util.py b/emcommon/util.py similarity index 100% rename from src/util.py rename to emcommon/util.py diff --git a/js/__translated_src__/__init__.js b/emcommon_translated_js/__init__.js similarity index 92% rename from js/__translated_src__/__init__.js rename to emcommon_translated_js/__init__.js index 3f302ad..b7753d1 100644 --- a/js/__translated_src__/__init__.js +++ b/emcommon_translated_js/__init__.js @@ -1,11 +1,11 @@ -// Transcrypt'ed from Python, 2024-04-08 23:53:06 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import * as ActiveTravelCalculations from './metrics.active_travel.active_travel_calculations.js'; import * as CarbonCalculations from './metrics.carbon.carbon_calculations.js'; import * as SurveysSummary from './metrics.surveys.surveys_summary.js'; import * as MetricsSummaries from './metrics.metrics_summaries.js'; import * as Logger from './logger.js'; -export {CarbonCalculations, SurveysSummary, ActiveTravelCalculations, MetricsSummaries, Logger}; +export {ActiveTravelCalculations, MetricsSummaries, SurveysSummary, CarbonCalculations, Logger}; var __name__ = '__main__'; //# sourceMappingURL=__init__.map \ No newline at end of file diff --git a/emcommon_translated_js/__init__.project b/emcommon_translated_js/__init__.project new file mode 100644 index 0000000..81e1939 --- /dev/null +++ b/emcommon_translated_js/__init__.project @@ -0,0 +1 @@ +{"options": {"source": "./emcommon/__init__.py", "anno": false, "alimod": false, "build": false, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": true, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": false, "keycheck": false, "license": false, "map": false, "nomin": true, "opov": false, "outdir": "../emcommon_translated_js", "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": null, "xtiny": false, "star": false}, "modules": [{"source": "/Users/jgreenle/miniconda3/lib/python3.11/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/org.transcrypt.__runtime__.js"}, {"source": "./emcommon/__init__.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/__init__.js"}, {"source": "./emcommon/metrics/active_travel/active_travel_calculations.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/metrics.active_travel.active_travel_calculations.js"}, {"source": "./emcommon/metrics/active_travel/standard_met_mode_map.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/metrics.active_travel.standard_met_mode_map.js"}, {"source": "./emcommon/logger.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/logger.js"}, {"source": "./emcommon/metrics/carbon/carbon_calculations.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/metrics.carbon.carbon_calculations.js"}, {"source": "./emcommon/metrics/surveys/surveys_summary.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/metrics.surveys.surveys_summary.js"}, {"source": "./emcommon/survey/conditional_surveys.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/survey.conditional_surveys.js"}, {"source": "./emcommon/metrics/metrics_summaries.py", "target": "/Users/jgreenle/openpath/e-mission-common/emcommon/../emcommon_translated_js/metrics.metrics_summaries.js"}]} \ No newline at end of file diff --git a/js/__translated_src__/logger.js b/emcommon_translated_js/logger.js similarity index 97% rename from js/__translated_src__/logger.js rename to emcommon_translated_js/logger.js index d024c8f..b85ab63 100644 --- a/js/__translated_src__/logger.js +++ b/emcommon_translated_js/logger.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-01 15:20:09 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'logger'; export var log_debug = function () { diff --git a/js/__translated_src__/metrics.active_travel.active_travel_calculations.js b/emcommon_translated_js/metrics.active_travel.active_travel_calculations.js similarity index 98% rename from js/__translated_src__/metrics.active_travel.active_travel_calculations.js rename to emcommon_translated_js/metrics.active_travel.active_travel_calculations.js index e3e4f77..f6751c9 100644 --- a/js/__translated_src__/metrics.active_travel.active_travel_calculations.js +++ b/emcommon_translated_js/metrics.active_travel.active_travel_calculations.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-01 15:20:09 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {standard_met_mode_map} from './metrics.active_travel.standard_met_mode_map.js'; import {log_warn} from './logger.js'; diff --git a/js/__translated_src__/metrics.active_travel.standard_met_mode_map.js b/emcommon_translated_js/metrics.active_travel.standard_met_mode_map.js similarity index 98% rename from js/__translated_src__/metrics.active_travel.standard_met_mode_map.js rename to emcommon_translated_js/metrics.active_travel.standard_met_mode_map.js index 9472211..2157fc4 100644 --- a/js/__translated_src__/metrics.active_travel.standard_met_mode_map.js +++ b/emcommon_translated_js/metrics.active_travel.standard_met_mode_map.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-01 15:20:09 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'metrics.active_travel.standard_met_mode_map'; export var MAX_VALUE = float ('inf'); diff --git a/js/__translated_src__/metrics.carbon.carbon_calculations.js b/emcommon_translated_js/metrics.carbon.carbon_calculations.js similarity index 98% rename from js/__translated_src__/metrics.carbon.carbon_calculations.js rename to emcommon_translated_js/metrics.carbon.carbon_calculations.js index cfb9d00..480a80b 100644 --- a/js/__translated_src__/metrics.carbon.carbon_calculations.js +++ b/emcommon_translated_js/metrics.carbon.carbon_calculations.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-02 16:56:15 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {log_debug} from './logger.js'; var __name__ = 'metrics.carbon.carbon_calculations'; diff --git a/js/__translated_src__/metrics.metrics_summaries.js b/emcommon_translated_js/metrics.metrics_summaries.js similarity index 98% rename from js/__translated_src__/metrics.metrics_summaries.js rename to emcommon_translated_js/metrics.metrics_summaries.js index 60a5fd0..b66521e 100644 --- a/js/__translated_src__/metrics.metrics_summaries.js +++ b/emcommon_translated_js/metrics.metrics_summaries.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-02 16:53:40 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import * as Logger from './logger.js'; var __name__ = 'metrics.metrics_summaries'; diff --git a/js/__translated_src__/metrics.surveys.surveys_summary.js b/emcommon_translated_js/metrics.surveys.surveys_summary.js similarity index 98% rename from js/__translated_src__/metrics.surveys.surveys_summary.js rename to emcommon_translated_js/metrics.surveys.surveys_summary.js index 82bb15e..31501c6 100644 --- a/js/__translated_src__/metrics.surveys.surveys_summary.js +++ b/emcommon_translated_js/metrics.surveys.surveys_summary.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-09 14:43:57 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {survey_prompted_for_trip} from './survey.conditional_surveys.js'; import * as Logger from './logger.js'; diff --git a/js/__translated_src__/org.transcrypt.__runtime__.js b/emcommon_translated_js/org.transcrypt.__runtime__.js similarity index 99% rename from js/__translated_src__/org.transcrypt.__runtime__.js rename to emcommon_translated_js/org.transcrypt.__runtime__.js index 46e2242..dd79c22 100644 --- a/js/__translated_src__/org.transcrypt.__runtime__.js +++ b/emcommon_translated_js/org.transcrypt.__runtime__.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-01 15:20:09 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; diff --git a/js/__translated_src__/survey.conditional_surveys.js b/emcommon_translated_js/survey.conditional_surveys.js similarity index 98% rename from js/__translated_src__/survey.conditional_surveys.js rename to emcommon_translated_js/survey.conditional_surveys.js index 4e45ec1..cc606e9 100644 --- a/js/__translated_src__/survey.conditional_surveys.js +++ b/emcommon_translated_js/survey.conditional_surveys.js @@ -1,4 +1,4 @@ -// Transcrypt'ed from Python, 2024-04-09 14:32:55 +// Transcrypt'ed from Python, 2024-04-11 11:59:22 import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import * as Logger from './logger.js'; var __name__ = 'survey.conditional_surveys'; diff --git a/js/index.js b/index.js similarity index 86% rename from js/index.js rename to index.js index b55f6b5..246b4f9 100644 --- a/js/index.js +++ b/index.js @@ -1,4 +1,4 @@ -import * as TranslatedCode from './__translated_src__/__init__.js'; +import * as TranslatedCode from './emcommon_translated_js/__init__.js'; /** * @description Converts a Python dict object to a plain JS object diff --git a/js/__translated_src__/__init__.project b/js/__translated_src__/__init__.project deleted file mode 100644 index 5013399..0000000 --- a/js/__translated_src__/__init__.project +++ /dev/null @@ -1 +0,0 @@ -{"options": {"source": "./src/__init__.py", "anno": false, "alimod": false, "build": false, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": true, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": false, "keycheck": false, "license": false, "map": false, "nomin": true, "opov": false, "outdir": "../js/__translated_src__", "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": null, "xtiny": false, "star": false}, "modules": [{"source": "/Users/jgreenle/miniconda3/lib/python3.11/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/org.transcrypt.__runtime__.js"}, {"source": "./src/__init__.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/__init__.js"}, {"source": "./src/metrics/active_travel/active_travel_calculations.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/metrics.active_travel.active_travel_calculations.js"}, {"source": "./src/metrics/active_travel/standard_met_mode_map.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/metrics.active_travel.standard_met_mode_map.js"}, {"source": "./src/logger.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/logger.js"}, {"source": "./src/metrics/carbon/carbon_calculations.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/metrics.carbon.carbon_calculations.js"}, {"source": "./src/metrics/surveys/surveys_summary.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/metrics.surveys.surveys_summary.js"}, {"source": "./src/survey/conditional_surveys.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/survey.conditional_surveys.js"}, {"source": "./src/metrics/metrics_summaries.py", "target": "/Users/jgreenle/openpath/e-mission-common/src/../js/__translated_src__/metrics.metrics_summaries.js"}]} \ No newline at end of file diff --git a/js/__translated_src__/util.js b/js/__translated_src__/util.js deleted file mode 100644 index 9eabdeb..0000000 --- a/js/__translated_src__/util.js +++ /dev/null @@ -1,45 +0,0 @@ -// Transcrypt'ed from Python, 2024-04-01 15:20:09 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; -var __name__ = 'util'; -export var memoize = function (fn) { - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - switch (__attrib0__) { - case 'fn': var fn = __allkwargs0__ [__attrib0__]; break; - } - } - } - } - else { - } - var _cache = dict ({}); - var wrapper = function () { - var kwargs = dict (); - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - switch (__attrib0__) { - default: kwargs [__attrib0__] = __allkwargs0__ [__attrib0__]; - } - } - delete kwargs.__kwargtrans__; - } - var args = tuple ([].slice.apply (arguments).slice (0, __ilastarg0__ + 1)); - } - else { - var args = tuple (); - } - if (!__in__ (tuple ([str (args), str (kwargs)]), _cache)) { - _cache.__setitem__ ([str (args), str (kwargs)], fn (...args, __kwargtrans__ (kwargs))); - } - return _cache.__getitem__ ([str (args), str (kwargs)]); - }; - return wrapper; -}; - -//# sourceMappingURL=util.map \ No newline at end of file diff --git a/js/package.json b/package.json similarity index 100% rename from js/package.json rename to package.json