Git Product home page Git Product logo

environmental-sensing's People

Contributors

loco-philippe avatar martin1d544 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

environmental-sensing's Issues

Observation.from_obj does not work on Time Intervals from JSON with modecodec='dict'.

Describe the bug
When modecodec='dict', Observation.from_obj converts ISO dates to datetimes correctly, but cannot convert date intervals.

To Reproduce
print(Observation.from_obj('{"type":"observation","name":"test_datation_1_valid_2","data":{"datation":{"type":"DatationValue","value":[{"record":0,"codec":["2022-02-01T00:00:00.000Z","2022-02-02T00:00:00.000Z"]}]}}}'))

returns:

name: test_datation_1_valid_2
data:
    ["datation", ["0001-01-01T00:00:00+00:00"]]

Expected behavior
should return

name: test_datation_1_valid_2
data:
    ["datation", ["2022-02-01T00:00:00.000Z", "2022-02-02T00:00:00.000Z"]]

dict argument

Describe the bug
def from_csv(cls, filename='ilist.csv', var=None, header=True, nrow=None,
optcsv={'quoting': csv.QUOTE_NONNUMERIC}, dtype=ES.def_dtype):

Expected behavior
def from_csv(cls, filename='ilist.csv', var=None, header=True, nrow=None, dtype=ES.def_dtype, **kwargs):

add setters and getters for codec and keys

Is your feature request related to a problem? Please describe.
simplify update of Iindex hash value

Describe the solution you'd like
internal attributes : _keys and _codec
getters (@Property) and setters (set_keys, set_codec)

Observation.applyfilter() does not work when filter contains only a list of True

Describe the bug
applyfilter method inherited from Ilist does not properly work when used on an Observation with a list of True

To Reproduce
obs=Observation([['datation', ['2022-09-01T00:00:00+00:00','2022-09-02T00:00:00+00:00']], ['location', [[2.1, 45.1],[2.2, 45.2]]]]) obs.setfilter([True, True])
obs.applyfilter()

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\ilist.py", line 717, in applyfilter
minind = min(il.lindex[ifilt].recordfromvalue(reverse))
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\iindex.py", line 662, in recordfromvalue
if not value in self.codec: raise IndexError('value not present')
IndexError: value not present

Expected behavior
No error should be raised.

module analysis

Is your feature request related to a problem? Please describe.
Mauvaises performances liées aux données d'analyse non persistante

Describe the solution you'd like
Module analysis (nouvelle classe)

Add geojson geometry in ObsJson

Is your feature request related to a problem? Please describe.
Simplify MongoDB request

Describe the solution you'd like
new option in to_obj(json) method

add json format with dict structure

Is your feature request related to a problem? Please describe.
Difficult to filter Observation in MongoDB

Describe the solution you'd like
Define a dict json format in witch MongoDB request can filter records

Describe alternatives you've considered
Actual json format

json_info parameter in Ilist.json does not work on Observation with precisely one element

Describe the bug
json_info parameter in Ilist.json does not work on Observation with precisely one element.

To Reproduce
obs = Observation([['datation', ["2022-09-01T00:00:00+00:00"]]])
obs_json=obs.json(json_info=True)

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\ilist.py", line 993, in json
return self.to_obj(**kwargs)
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\esobservation.py", line 459, in to_obj
dic |= self._info(**option)
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\esobservation.py", line 504, in _info
dcinf |= self._infoOther()
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\esobservation.py", line 530, in _infoOther
dcinf[ES.obs_complet] = self.complete
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\ilist.py", line 490, in complete
return self.lencomplete == len(self) and self.consistent
File "C:\Users\dimit\Documents\Environmental-Sensing\python\observation\ilist.py", line 495, in consistent
return max(Counter(zip(*self.iidx)).values()) == 1
ValueError: max() arg is an empty sequence

Ilist.Iext too permissive

Describe the bug
see example

To Reproduce
i2 = Ilist.Iext([[0,0,0,0],['a','b','c','d'],[1,2,3]])
print(i2)
["i0", [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
["i1", ["a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d", "a", "a", "a", "b", "b", "b", "c", "c", "c", "d", "d", "d"]]
["i2", [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]]

Expected behavior
Error message

duplicate Iindex name

Describe the bug
two Iindex can have the same name

Expected behavior
Check the unicity of an Iindex name in the init method

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.