Skip to content

Commit

Permalink
bring up to date with causx branch (#616)
Browse files Browse the repository at this point in the history
* start Virtualized Table

* css table

* tags: {[key: string]: string}

* fix typo

* tags- with all the logs

* css table

* css table-virtual

* ths css work!!

* selection

* highlight

* header styling

* output oreview

* table with scroll

* comments

* test_one- test_annotation_suggestion

* support for drag-dropping/uploading multiple data files

* some changes from the commits on table virtual

* less render tableData

* GET api/causx/project/upload/fidil_json/

* fix repeated function name

* and another fix

* ref

* tableData: { [indexRow: number]: TableCell[] }

* row getter is being loaded infinatly

* Abhinav | Issues 579, 585 | Fix copy annotations issues (#586)

* Abhinav | Allow complete copy from source annotation with selection modification

* Abhinav | Convert empty cells to NaN in copy_annotations

* Abhinav | Create blocks constraints between every blocks
* Previously the constraints were created only when 2 blocks shared same vertical or horizontal space

* configure entire fidil upload endpoint

* Remove duplicate colon in the default fidil_endpoint variable

* Get the filename from the data_file request param

* Get the filename from the data_file request param when download files

* fetchRows

* some tweaks to fidil download/upload

* add fidil test

* performance

* Add http:// to the causx endpoint used to upload the fidil files

* Remove trailing slash from the fidil json download endpoint

* Update causx_utils.py

Update FIDIL endpoint

* calculate the indexes to send to the backend

* updateQnodeCells if (upadateQnodeContent || showQnode)

* service - startIndex=0, endIndex=50

* returnTableData and append qnodes

* FAST!

* handleOnSelectionChange

* typo

* while (Object.keys(tableData).length < table.dims[0]) { // add rows to the display table- infinitive!!!

* fix qnode indexing error

* fix infinite loop

* add a performance improvement for adding empty cells

* undo fix qnode indexing error and the bug it causes

* tidiness and loading refactor

* fix typo, and abbreviate test comparison by sending range

* add sheet caching

* typescript fix

* change default part_end for partialcsv to something smaller

* scrolToTop on change wikistore.table.table

* - add extra columns to min 26
- add one extra for the scroll bar
- block the additional columns and rows
- when load new table- start new set for the loadedrows

* typo

* check for wider variety of errors from service

* add extra rows to the end, if the startIndex is early loaded.

* reorder functions (only committing so later changes are clear)

* don't send main subject to country wikifier by default

* add the start/end arguments to calc_params

* slight tweak

* updateStatment

* typescript fix

* move loadedRows to wikiStore.table.loadedRows and create wikiStore.table.currentRowIndex

* update causx to match

* if (startIndex < 0) { startIndex = 0; }

* if (startIndex < 0) { startIndex = 0; }

* bug fix: forgot to cast to int

* update test files

* fixed duplicated annotation blocks bug

* partial csv

* partialCsv min 10 columns

* add "part_count" argument instead of part_start, part_end

* typo

* fix min columns and rows

* fix rows len

* 2.11.0

* don't send duplicates to wikifier service

* Faster wikifier (#610)

* initial version of faster wikifier

* fix deletion

* wikification color bug

* tweaks

* get rid of all references to kg.sheet

* fix various bugs

* fix small bug

* upgrade python version on git

* bump readme version to 3.8

* verbose test on github to diagnose failing test

* try changing test scope?

* use count for partial csv

* update test

* update history

* remove submit button (#609)

* todo comments

* getting rid of the submit button on the block menu

* changes the defaultPosition of popup

* fixed get node by ID

* not be possible to create a property for a block whose type is different from the block

* deactivate table (if there is no selection)

* select the block that just created

Co-authored-by: ChanaChelem <[email protected]>

Co-authored-by: ChanaChelem <[email protected]>

* update history

* only add factor class prefix to predefined factor classes

Co-authored-by: ChanaChelem <[email protected]>
Co-authored-by: Abhinav Kumar Thakur <[email protected]>
Co-authored-by: g1eb <[email protected]>
Co-authored-by: kyao <[email protected]>
  • Loading branch information
5 people authored Aug 23, 2021
1 parent bdb9baf commit 4ade756
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
47 changes: 44 additions & 3 deletions backend/causx/causx_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,46 @@
from causx.coords import coords
from t2wml_web import get_kg

factor_classes = set([
"AgriculturalIndustry",
"AirPollutionLevels",
"AirTransportation",
"AlternativeEnergyIndustry",
"Corruption",
"CriminalActivities",
"EconomicProduction-GDP",
"EducationAvailability",
"EmploymentLevel",
"FoodAndNutritionLevel",
"ForeignArmsTrade",
"ForeignInvestment",
"FreedomOfExpression",
"GovernmentAbilityToAddressBasicNeeds",
"GovernmentEffectiveness",
"GovernmentStability",
"GovernmentTransparency",
"GroundTransportation",
"HealthcareAvailability",
"InternationalTrade",
"JudicialActivity",
"ManufacturingIndustry",
"MilitarySpending",
"MiningIndustry",
"PetroleumIndustry",
"PopulaceEducationLevel",
"PovertyRate",
"PowerAvailability",
"ProvisionOfAidOrSupport",
"Refugees",
"SanitaryConditions",
"SecuritySafetyLevel",
"ServicesIndustry",
"TransportationInfrastructure",
"UtilitiesInfrastructure",
"WaterAvailability",
"WaterTransportation",
"WealthInequality",
])

def clean_id(input):
if not input:
Expand Down Expand Up @@ -428,9 +468,10 @@ def create_fidil_json(calc_params):
variable_dict=causx_get_variable_dict(calc_params.project).get(variable_id, {})
tags_dict={"FactorClass":"","Relevance":"","Normalizer":"","DocID":""}
tags_dict.update(variable_dict.get("tags", {}))
if tags_dict["FactorClass"]:
if "http://ontology.causeex.com/ontology/odps/ICM#" not in tags_dict["FactorClass"]:
tags_dict["FactorClass"]="http://ontology.causeex.com/ontology/odps/ICM#"+tags_dict["FactorClass"]

factor_class = tags_dict["FactorClass"]
if factor_class in factor_classes:
tags_dict["FactorClass"]="http://ontology.causeex.com/ontology/odps/ICM#"+factor_class
units = tags_dict.pop("Units", "")
main_subject_id = statement["subject"]
id = hashlib.md5(id_str.encode()).hexdigest()
Expand Down
1 change: 1 addition & 0 deletions backend/t2wml_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def get_project_instance(project_folder):
update_t2wml_settings(project)
return project


def set_web_settings():
if not os.path.isdir(CACHE_FOLDER):
os.makedirs(CACHE_FOLDER, exist_ok=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7197,4 +7197,4 @@
],
"layerType": "qNode"
}
}
}

0 comments on commit 4ade756

Please sign in to comment.